Hello there, I'm trying to conditionally hide a row on the server side. My code looks like this:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) |
{ |
if (e.Item.OwnerTableView.Name == "Customer") |
{ |
} |
if (e.Item.OwnerTableView.Name == "CustomerDetail") |
{ |
CustomerDetail detail = (CustomerDetail)e.Item.DataItem; |
if (detail.IsCancelled) |
{ |
// Hide the row, e.Item.Visible = false doesn't seem to work |
} |
} |
} |
} |
The good news is the code gets hit during debugging, and at that point, I'd like to hide the row. The row does reside inside of a DetailTable/GridTableView. Do I need to do this inside of another server side event? Or should I filter my results when the detailtable gets databound?
I've searched these forums for quite a while but no luck . Any help is greatly appreciated.
-- Mike