Hi to all. I am controlling addition of columns to the GroupByBox programmatically, and I want to have the GroupByBox displayed for user information and for sorting purposes only. I do not wish for users to be able to drag columns into the GroupByBox, as grouping on some of the columns is not meaningful.
Is there any way that I can disable the ability to drop columns into the GroupByBox in the scenario described above?
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.ViewStyleBand = ViewStyleBand.OutlookGroupBy; e.Layout.Override.AllowGroupBy = DefaultableBoolean.False; }
Thanks for that Mike. Your code works like a treat. Interestingly I've noticed that setting the same properties at design time does not work.
You are correct - I just tested the design time settings again and it has worked as you said. I must have done something wrong on my first test. Thanks.
There's no reason why setting the properties at design-time would make any difference. Perhaps you are loading a layout into the grid that is overriging the design-time settings? Or setting these properties in code somewhere else?