Hello, I have a Radgrid with a DetailTable inside. This Grid has orders with order items in the detail table.
I have a OnDataBound event on this Grid. This event checks for the value in a column and then sets the row backcolor on it.
It works fine until I try to expand into the detailtable since then it tries to execute the OnDatabound event and the field I am checking does not exists in the detail table.
Below is the OnDataBound event:
The code fails when trying to expand into the detail table. It fails on line:
TableCell myCell = dataItem["ready"];
since the "ready" column does not exist in the detail table.
Can someone let me know how I can fix this?
Thanks.
I have a OnDataBound event on this Grid. This event checks for the value in a column and then sets the row backcolor on it.
It works fine until I try to expand into the detailtable since then it tries to execute the OnDatabound event and the field I am checking does not exists in the detail table.
Below is the OnDataBound event:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem dataItem = (GridDataItem)e.Item; TableCell myCell = dataItem["ready"]; if ((myCell.Text == "True")) { dataItem.BackColor = System.Drawing.Color.SteelBlue; } } }The code fails when trying to expand into the detail table. It fails on line:
TableCell myCell = dataItem["ready"];
since the "ready" column does not exist in the detail table.
Can someone let me know how I can fix this?
Thanks.