For a radgrid, in the GridNeedDataSource Event, the eventargs include:
RebindReason
IsFromDetailTable
This useful for determining whether the rebinding is caused by Parent or Child grid.
What if I have a 3-tier grid?
Parent > Child > Grandchild
This boolean parameter will only tell me whether or not the grid raising the event was the parent, it cannot tell me whether it was the Child or Grandchild… or am I missing something?
How can I determine which depth of grid hierarchy raised the event?
EDIT: I suspect I can exploit the sender.Equals() method but I am not sure how to target the detail or master table controls
You should use the
DetailTableDataBindevent for this purpose instead. You can refer to the RadGrid programmatic hierarchy binding demo. The DetailTableDataBind event is the recommended approach for binding detail tables. It fires for every detail table that is to be databound. Using the event argument object, you can get the GridTableView instance that is binding (e.DetailTable). If you have specified names for your tables,e.DetailTable.Nameidentifies your detail table for the current parent grid item.