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

Refresh grid on one control when form is submitted on other control

4 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
tmorford
Top achievements
Rank 1
tmorford asked on 02 Sep 2010, 02:03 PM
Hey all I have a page with a bunch of accordion panels with controls in them, what I need is when they submit a form on one control I need the radgrid on a different control to refresh how do I do this?

thanks!
Panels:
<div>
                    <h3>
                        <a href="#">Create Groups</a></h3>
                    <div>
                        <asp:UpdatePanel ID="UpdatePanelCreateGroups" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div>
                                    <oti:CreateGroup ID="CreateGroup" runat="server" />
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
                <div>
                    <h3>
                        <a href="#">Edit Questions</a></h3>
                    <div>
                        <asp:UpdatePanel ID="UpdatePanelEditQuestions" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div>
                                    <oti:EditQuestionsGroup ID="EditQuestionsGroup" runat="server" />
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
                <div>
                    <h3>
                        <a href="#">Edit Group Questions</a></h3>
                    <div>
                        <asp:UpdatePanel ID="UpdatePanelEditGroupQuestions" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div>
                                    <oti:EditGroup ID="EditGroup" runat="server" />
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>

4 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 02 Sep 2010, 02:15 PM
On the event of the control that submits the form call the Rebind() method of the RadGrid you want to refresh.

I hope that helps.
0
tmorford
Top achievements
Rank 1
answered on 02 Sep 2010, 02:31 PM
Yes thanks but how do I get get access to the radgrid on a different control?
I have tried Page.FindControl that did not work.

thanks!
0
tmorford
Top achievements
Rank 1
answered on 02 Sep 2010, 05:17 PM
RadGrid rg = ((RadGrid)((UserControl)((UpdatePanel)ButtonSaveQuestions.NamingContainer.NamingContainer.FindControl("UpdatePanelEditQuestions")).FindControl("EditQuestionsGroup")).FindControl("RadGridEditQuestions"));
            rg.Rebind();
This sees the grid but the Rebind does not seem to work.
0
Radoslav
Telerik team
answered on 03 Sep 2010, 12:15 PM
Hi Tmorford,

Could you please elaborate a bit more on your scenario. Do you have any ajax settings added on the user control or on the page? If you make an ajax request to the server from a control you need to ajaxify the RadGrid too. In that way the RadGrid will be refreshed on the client when you called the Rebind method.

On the following online resources you could find more information about ajaxifying RadControls:
http://www.telerik.com/help/aspnet-ajax/ajxajaxmanager.html
http://www.telerik.com/help/aspnet-ajax/ajxusercontrols.html
http://www.telerik.com/help/aspnet-ajax/ajxajaxmasterpage.html
http://www.telerik.com/help/aspnet-ajax/ajxajaxpanel.html

Greetings,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
tmorford
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
tmorford
Top achievements
Rank 1
Radoslav
Telerik team
Share this question
or