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

Radgrid datasource is not getting refreshed with new datasource assigned at run time!

2 Answers 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Selvakumar Palanisamy
Top achievements
Rank 1
Selvakumar Palanisamy asked on 25 Feb 2009, 09:04 AM
Hi, 
                                I have two rad grid (Grid A, Grid B) controls in my .aspx page inherited from Microsoft.Practices.CompositeWeb.Web.UI.Page class. The datasource for GridA is assigned in the .aspx.cs file using gridA.DataSource property assigned with a DataTable for it, its data is getting displayed when the page gets initialized.

                                But the data for GridB need be updated with a DataSource (which gets created based on the GridA's row selection). When I assign the DataSource for GridB, its not getting updated and nothing is displayed on it.

Here is the related code snippets from my page!

.ASPX.CS:

radGridClientDetails_ItemCommand
{
// GridA is ItemCommand event, the event is getting fired properly and I am able to debug all the code blocks
if(e.CommandName == "RowClick")

{

// Gets the selected clientDbId from GridA's selected row
selectedClientDbId =

 

Convert.ToInt32(this.radGridClientDetails.SelectedValue.ToString());

  

 // Generates the new datasource based on the dbId
_generateOutputDataFinderService.GetReportSpecDetails(clientDatabaseID);
// Assigining it to the GridB datasource
this.radGridReportDetails.DataSource = value;
}

 

}

.ASPX:  

<

asp:Content>
<

telerik:RadAjaxPanel>
<telerik:radgrid id="radGridA">
</telerik:radgrid>
</
telerik:RadAjaxPanel

<telerik:RadAjaxPanel>
<telerik:radgrid id="radGridB">
</telerik:radgrid>
</
telerik:RadAjaxPanel>
-- No <asp:ObjectDataSource> 

</

asp:Content> 

 

Please let me know where I am missing something in order to show the data in the GridB radGrid... Thanks a lot for your support..

Thanks,
Selva

 

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Feb 2009, 01:40 PM
Hi Selva,

Try Rebinding the GridB after setting its DataSource in the ItemCommand event of GridA. You can also refer the online demo which shows how to implement dependant Grids.
Related grids

Shinu
0
Selvakumar Palanisamy
Top achievements
Rank 1
answered on 25 Feb 2009, 01:53 PM
Hi, Actually I tried with Rebind(), DataBind() but the GridB is not getting updated with the new DataSource... Is there any other things which I need to makesure?  Please help me out..

Thanks,
Selva
Tags
Grid
Asked by
Selvakumar Palanisamy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Selvakumar Palanisamy
Top achievements
Rank 1
Share this question
or