I have a master grid to which I am binding a Detail grid only if it is part of a "series". All other rows should not have a detail table. There's no real key relationship between the master and detail table otherwise.
When I try to just bind the detail grid on only the rows which require it, it binds the entire master table view to the detail grid on the rows which don't. I cannot get the detail grid to have a null datasource.
I don't know if I'm explaining it well, but how do I prevent the grid from showing the entire master table view on the detail view when there are no records to explicitly bind?
Thanks.
When I try to just bind the detail grid on only the rows which require it, it binds the entire master table view to the detail grid on the rows which don't. I cannot get the detail grid to have a null datasource.
I don't know if I'm explaining it well, but how do I prevent the grid from showing the entire master table view on the detail view when there are no records to explicitly bind?
protected void RadGridCE_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) |
{ |
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; |
if (dataItem["is_series"].Text == "1") |
{ |
int series_id = int.Parse(dataItem["series_id"].Text); |
e.DetailTableView.DataSource = (FarranMedia.Classes.OnlineCE.CECourseGetBySeriesID(series_id)).Tables[0]; |
} |
else |
{ |
e.DetailTableView.DataSource = null; |
} |
} |
Thanks.