See code below.
The SwapColumns works in all cases.
The expand logic for the group works when the swap columns does not occur.
When the swap columns logic does occur, I loose the expand value and everything is expanded.
Any ideas would be greatly appreciated.
Thanks,
Todd.
The SwapColumns works in all cases.
The expand logic for the group works when the swap columns does not occur.
When the swap columns logic does occur, I loose the expand value and everything is expanded.
Any ideas would be greatly appreciated.
Thanks,
Todd.
protected void ScheduleGrid_PreRender(object sender, EventArgs e) |
{ |
//Swap |
if (divisionObj.SwapHomeAndAway) |
ScheduleGrid.MasterTableView.SwapColumns("Home", "Away"); |
//Expand/Collapse groups |
ArrayList groupItems = new ArrayList(ScheduleGrid.MasterTableView.GetItems(GridItemType.GroupHeader)); |
foreach (GridGroupHeaderItem item in groupItems) |
{ |
bool expanded = false; |
ArrayList childItems = new ArrayList(item.GetChildItems()); |
foreach (GridItem child in childItems) |
{ |
RadComboBox rcb = (RadComboBox)child.FindControl("DispositionComboBox"); |
if (rcb != null && rcb.SelectedValue != "") |
{ |
if (Convert.ToInt32(rcb.SelectedValue) == DispositionTypes.PENDING) |
{ |
expanded = true; |
break; |
} |
} |
} |
item.Expanded = expanded; |
} |
} |