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

RadGrid rebind does not work

2 Answers 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 05 Oct 2011, 08:48 PM
I have multiple radgrids in an Asp web form. Things are working quite well until I found a problem.

All grids are reading data from a datasource in the backend. There are two grids are sharing one data field. It means that if the data column changes on one grid it should updates to the other grid as well. In the ASPX file, I define the AJAX manager as follow,

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

 

<AjaxSettings>

 

 

 

<telerik:AjaxSetting AjaxControlID="rgOpenHole">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="rgOpenHole" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

<telerik:AjaxSetting AjaxControlID="rgDrillString">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="rgDrillString" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

<telerik:AjaxSetting AjaxControlID="rgHarzard">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="rgHarzard" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

</AjaxSettings>

 

 

 

</telerik:RadAjaxManager>

 


In this case, if the grid rgOpenHole changes, it should populate the grid rgHarzard, but it does not work!

I put code to force the update in  rgOpenHole_UpdateCommand like this,

rgOpenHole.Rebind()

rgHarzard.Rebind()

The rgOpenHole works as usual but rgHarzard does not update! I step into the code debugger and it does step through rgHarzard.Rebind(). It seems that the rgHarzard does not react at all.

I know if I put rgOpenHole and rgHarzard into one single UpdateControls tag, it update the rgHazard, but it also causes other issue. So I wonder if I can update it through java script and ajax call in the client site?

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

 

<AjaxSettings>

 

 

 

<telerik:AjaxSetting AjaxControlID="rgOpenHole">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="rgOpenHole" LoadingPanelID="RadAjaxLoadingPanel1" />

 

<telerik:AjaxUpdatedControl ControlID="rgHarzard" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

 

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

<telerik:AjaxSetting AjaxControlID="rgDrillString">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="rgDrillString" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

</AjaxSettings>

 

 

 

</telerik:RadAjaxManager>

 

 

 

 


Any idea?

Simon Feng

2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 06 Oct 2011, 06:56 AM
Hello,

Please provide your code or please explain in detail which type of functionality you want.(like : when i update Grid1 at that time i also want to update the Grid2)

Thanks,
Jayesh Goyani
0
Simon
Top achievements
Rank 1
answered on 06 Oct 2011, 01:02 PM
Actually I have just fixed the problem.
In the grid rgOpenHole, I setup an event handler like this

 

 

<ClientSettings EnableRowHoverStyle="true">

 

 

 

   <ClientEvents OnRowDataBound="UpdateHarzardGrid()"/>

 

 

 

</ClientSettings>

 


Then the function UpdateHarzardGrid is defined like this 

 

 

function UpdateHarzardGrid() {

 

 

 

    var rgHarzard_MT = $find("<%=rgHarzard.MasterTableView.ClientID %>")

 

 

 

    if (rgHarzard_MT != null)

 

        rgHarzard_MT.rebind();

}

After this, every time when rgOpenHole changes, rgHarzard will changes also.

Thank you for your reply.

Simon

Tags
Grid
Asked by
Simon
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Simon
Top achievements
Rank 1
Share this question
or