This is a migrated thread and some comments may be shown as answers.

MasterPage UpdatePanel and RadGrid

3 Answers 228 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jako
Top achievements
Rank 1
Jako asked on 03 May 2013, 02:20 PM
Hi everyone

I have a MasterPage with an Updatepanel with some info on. Then on the content page I have a radgrid with a nestedviewtemplate and on this template is a button that should update the Panel in the masterpage.

The code runs without error, but its not updating, When I put the NestedViewTemplate in an updatepanel as well, it breaks everything else:)

Is there a way around this? Here is my grid:
<telerik:RadGrid ID="uxTitleGrid" runat="server" ...>
    <MasterTableView>
        <NestedViewTemplate>   
            <h4>Change Title Details</h4>                   
            <fieldset>
                .
                .
                .
                <div style="float:right;">
                    <telerik:RadButton ID="uxRequestChange" runat="server" OnClick="uxRequestChange_OnClick" Text="Request Change" />
                </div>                   
            </fieldset>
        </NestedViewTemplate>
        <Columns>
            .
            .
            .
        </Columns>  
        <NoRecordsTemplate>
            No Records
        </NoRecordsTemplate>                                             
    </MasterTableView>         
</telerik:RadGrid>

and here is the code behind where I want to update the control
UpdatePanel uxHeaderUpdatePanel = (UpdatePanel)(Master.FindControl("uxHeaderUpdatePanel"));
uxHeaderUpdatePanel.Update();

I can add the uxRequestChange to the AsyncTrigger because it doesn't exist in the context when the page is loaded and because its in a grid, the ID will auto generate.

Any ideas?

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 08 May 2013, 08:41 AM
Hello Jako,

I have created a sample project illustrating the scenario you describe. The content in the UpdatePanel is changed on Click event of the button in the content page.
Please check the attachment.

Let me know if this is helpful.

Greetings,
Victor
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jako
Top achievements
Rank 1
answered on 10 May 2013, 12:33 PM
Hi Victor

This is almost there, its working, but I also have RadNotification on the Master Page that is called when the user clicks a event.

Its updating the Panel with the correct value, but the RadNotification doesn't have any text values, its empty?
0
Accepted
Viktor Tachev
Telerik team
answered on 15 May 2013, 11:03 AM
Hi Jako,

You could access the RadNotification control in a similar way as the label on the master page:

RadNotification notification = (RadNotification)Master.FindControl("RadNotification1");

This code should be placed in the code-behind of the content page.

To display the notification on an event you need to call the Show() method for the RadNotification in the event handler. How to do that is illustrated in this and this online demos. The text of RadNotification could be set with it's Text property. You could set the property in the markup or in the code-behind. You would find this article about RadNotification helpful.

You could find a project attached that incorporates RadNotification.

Kind regards,
Victor Tachev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Jako
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Jako
Top achievements
Rank 1
Share this question
or