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

Updating/ refreshing the controls which are in Rad ajax panel

1 Answer 718 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
ajay
Top achievements
Rank 1
ajay asked on 03 Feb 2015, 10:45 AM
 Hi, I am facing problem in updating/ refreshing the controls which are in Rad ajax panel .I have a Rad ajax panel in which i have placed a grid, and RadPanelBar side to side by placing them in table.when the user selects any record in grid the details of that record will be shown in it's beside RadPanelBar. So in this process of selecting records i am refreshing the Entire Rad ajax panel for getting the correct selected record details.But additionally what i want is when the user sorts the records of grid i need to refresh the grid only , for this i placed Radgrid again in other radajaxpanel which is creating the problems.

      My Radgrid is not getting updated with the click events of grid, when i click on link button of grid it should highlight the clicked row. But when i placed grid in Ajax panel it is not getting highlighted untill unleass i refresh the Grid. when i placed it in another nested rad ajax panel. Please help me how can i achieve refreshing the only the Radgrid while sorting?My design:
 
<telerik:RadPageView ID="radPage1" runat="server">
       <telerik:RadAjaxPanel ID="RadAjaxPanel3" runat="server" EnableAJAX="True" LoadingPanelID="RadAjaxLoadingPanel1"
                        ClientEvents-OnRequestStart="onRequestStart">
                        <table width="100%" cellpadding="0" cellspacing="0">
                            <tr>
                                <td style="width: 50%">
                              <%-- <telerik:RadAjaxPanel ID="RadAjaxPanel4" runat="server" EnableAJAX="True" LoadingPanelID="RadAjaxLoadingPanel1"
                               ClientEvents-OnRequestStart="onRequestStart"> --%>
 
                                   <telerik:RadGrid ID="radGrid" runat="server" AllowSorting="true" AllowFilteringByColumn="False"
                                        OnNeedDataSource="grdUnResolvedFaxes_NeedDataSource" Skin="Metro" CellSpacing="0"
                                        GridLines="None" Width="99%" PageSize="12" OnItemCommand="grdUnResolvedFaxes_ItemCommand"
                                        EnableViewState="true">....
                                         .....
                                         .....
                                  </telerik:RadGrid>
 
                             <%-- </telerik:RadAjaxPanel> --%>
 
                                </td>
 
                              <td style="width: 50%">
                                 <telerik:RadPanelBar runat="server" ID="pnlBar" ExpandMode="MultipleExpandedItems"
                                        Width="99%" Visible="false">
                                 <Items>
                             .................
                                 </Items>
                                  </telerik:RadPanelBar>
                               </td>
                              </tr>
                        </table>
                 </telerik:RadAjaxPanel>
 
              </telerik:RadPageView>

  For the Linkbutton click of the grid i added below code to update the grid   

         
      if (e.CommandName.ToLower() == "select")
         {
           RadAjaxPanel4.ResponseScripts.Add(String.Format("$find('{0}').ajaxRequest();", RadAjaxPanel3.ClientID));
         }

         

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 05 Feb 2015, 12:57 PM
Hello Ajay,

In order to achieve the required functionality you should use RadAjaxMnager instead of nested RadAjaxPanel's and use the RadAjaxManager's EventName property like this:

<telerik:RadAjaxManager runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="radGrid" EventName="SortCommand">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="radGrid" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="radGrid" EventName="SelectedIndexChanged">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="pnlBar" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

Give this a try and see if it works for you.


Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Ajax
Asked by
ajay
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or