protected void G_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
GridDataItem parentItem = e.DetailTableView.ParentItem as GridDataItem;
ParentID =
Convert.ToInt32(parentItem.Cells["PEIRS_IncidentID].Text);
switch (e.DetailTableView.DataMember)
{
case "IncidentSupps":
// get the data and set the datasource
e.DetailTableView.DataSource = BLL.
Supplement.GetSupplements(ParentID);
break;
case "IncidentSubjects":
// get the data and set the datasource
e.DetailTableView.DataSource = BLL.
Supplement.GetSubjects(ParentID);
break;
}
}
I am trying to pull the value of the PEIRS_IncidentID column from the MasterTableView so I can retrieve only those records with a matching PEIRS_IncidentID in the table bound to the GridDetailView.
When I debug and set a breakpoint at the ParentID = ... statment, parentItem.Cells["PEIRS_IncidentID].Text is always an empty string. When I enter ? parentItem.DataItem in the command window, it shows me all of the bound columns and values in those columns, and none are empty.
Why can I see the data in the command window, but cannot seem to access it in the parentItem variable in the code?
Thanks,
Jack