I have code:
My question:
How Can I distinguish MasterTableViewitems from DetailTables items durring ItemDataBound? I would like to chnage data for MasterTableView item, not for DetailTables item.
void tradeRadGrid_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridDataItem) |
{ |
DataRowView drv = e.Item.DataItem as DataRowView; |
if (drv != null) |
{ |
if (drv["Difference"] != DBNull.Value) |
{ |
int dif; |
int.TryParse(drv["Difference"].ToString(), out dif); |
TableCell tc = (e.Item as GridDataItem)["Difference"]; |
if (dif > 0) |
{ |
tc.BackColor = Color.FromArgb(176, 251, 159); |
} |
else if(dif < 0) |
{ |
tc.BackColor = Color.FromArgb(255, 176, 159); |
} |
} |
} |
} |
} |
How Can I distinguish MasterTableViewitems from DetailTables items durring ItemDataBound? I would like to chnage data for MasterTableView item, not for DetailTables item.