I have a RadGrid with a GridTemplateColumn that contains a UserControl that contains another RadGrid. In ItemCreate on the top-level grid (and I have also tried ItemDataBound) I set two properties on the nested grid.
}
Inside the nested grid it's NeedDataSource event uses the ContentArea property to construct its query.
What I am having trouble with is refreshing the top-level grid (which I need to do after a separate dialog window closes). Currently I am calling the code-behind through
which resets the DataSource and call DataBind(). When I do this the nested grid's NeedsDataSource gets call before the top-level grid's ItemDataBound event gets called and so it doesn't have the value of the ContentArea to use in its query.
Can you suggest how I am supposed to refresh the top-level grid and make sure those properties are reset on the nested grid?
Thanks in advance,
Anne
protected void StudentGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem gdi = (GridDataItem)e.Item;
StudentTasksGrid grid = (StudentTasksGrid)gdi.FindControl("TaskGrid");
grid.StudentId =
Convert.ToInt64(gdi.GetDataKeyValue("COEUserID"));
grid.ContentArea = (
ContentAreaType)Convert.ToInt32(gdi.GetDataKeyValue("COEContentAreaTypeID"));
...
}
Inside the nested grid it's NeedDataSource event uses the ContentArea property to construct its query.
What I am having trouble with is refreshing the top-level grid (which I need to do after a separate dialog window closes). Currently I am calling the code-behind through
function refreshGrid(sender, eventArgs) {
$find(
"ctl00_MainContent_RadAjaxManager1").ajaxRequest("Rebind");
}
which resets the DataSource and call DataBind(). When I do this the nested grid's NeedsDataSource gets call before the top-level grid's ItemDataBound event gets called and so it doesn't have the value of the ContentArea to use in its query.
Can you suggest how I am supposed to refresh the top-level grid and make sure those properties are reset on the nested grid?
Thanks in advance,
Anne