I have a WebHierarchicalDataGrid with the Outlook group-by feature enabled. When a column is grouped, I would like the column to disappear from the grid, since it is pointless to repeat the data in each row. Is there a way to do this and have it reappear when the column is "un-grouped"?
Thanks for your help
Hi awxs,
Thank you for posting in the community.
In this scenario, handling the GroupedColumnsChanged event of the grid can be used to manipulate the displayed columns of the grouped band. For instance:
protected void WebHierarchicalDataGrid1_GroupedColumnsChanged(object sender, Infragistics.Web.UI.GridControls.GroupedColumnsChangedEventArgs e) { e.Band.Columns.FromKey(e.GroupedColumns[0].ColumnKey).Hidden = true; }
Please let me know if this helps.
Please feel free to contact me if you have any further questions regarding this matter.
I am trying to do this also, and seem to be unable to get the columns grouped by to be hidden.
My code is as follows.
void DisplayResultsWebGrid_GroupedColumnsChanged(object sender, GroupedColumnsChangedEventArgs e)
{
foreach (GroupedColumn item in DisplayResultsWebGrid.GroupingSettings.GroupedColumns)
DisplayResultsWebGrid.Columns.FromKey(item.ColumnKey).Hidden = true;
}
Any suggestions as to why the columns are not hidden, the event code is called but nothing happens.
I had a similar code and everythings was working fine, until I've upgraded to version 12.2. After that, whatever I tried just can't hide those grouped columns. Anyone knows if this is a new bug or a behavior change? There's any known workaround?
Thanks.