What is the best way to determine if the ItemDataBound is Master or Detail Table?
I am trying to conditionally format the detail table row, not cell. This is based on a column that exists in both the Master and Detail tables. The formatting is working, but it is formatting both the Master and the detail table.
I see this code, but cannot figure out how to determine if e.Item is Master or Detail table:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = e.Item as GridDataItem;
if (dataItem["Country"].Text == "Mexico")
dataItem.CssClass = "MyMexicoRowClass";
}
}
Or if there is a better way to do this?
I am trying to conditionally format the detail table row, not cell. This is based on a column that exists in both the Master and Detail tables. The formatting is working, but it is formatting both the Master and the detail table.
I see this code, but cannot figure out how to determine if e.Item is Master or Detail table:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = e.Item as GridDataItem;
if (dataItem["Country"].Text == "Mexico")
dataItem.CssClass = "MyMexicoRowClass";
}
}
Or if there is a better way to do this?