To my knowledge there is no such built in method. My suggestion if it is important that you don't use recursion is to utlize the RowCollapsed
and RowExpanded
events in conjuction with a HashSet<GridEXRow>
to register and unregister rows that get expanded/collapsed.
public class ...
{
...
HashSet<GridEXRow> expandedRows = new HashSet<GridEXRow>();
public bool IsExpanded
{
get { return expandedRows.Count > 0; }
}
...
private void gridEX_RowCollapsed(object sender, Janus.Windows.GridEX.RowActionEventArgs e)
{
expandedRows.Remove(e.Row);
}
private void gridEXLocation_RowExpanded(object sender, Janus.Windows.GridEX.RowActionEventArgs e)
{
expandedRows.Add(e.Row);
}
}
Note that using this method there could be a performance hit when you Expand all (all rows added to expandedRows) and collapse. Collapse all would clear expandedRows, however when collapsing all you would still trigger RowCollapsed
for each row e.g. theres no such shortcut as doing expandedRows.Clear();
without first removing the event and then putting it back again.