I have 13 unbound columns defined in band 0. Some are visible, others are not. My domain entity contains over 20+ public properties. When I display the column chooser, all entity properties are displayed.
Is there any way to restrict the column chooser list to the defined columns under band 0?
Regards,
Bart
Set column.ExcludeFromColumnChooser
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v8.2~Infragistics.Win.UltraWinGrid.UltraGridColumn~ExcludeFromColumnChooser.html
Thanks for the answer, but it's the unmapped columns that pose a problem.
I know that for every defined column, I can set the ExcludeFromColumnChooser property. During the SetDataBinding, I've set hideNewColumns to true, wich hides all unmapped properties. But the column chooser apparently by default doesn't react in the same way.
Mike,
I resolved it like you stated. Works like a charm.
In the InitializeLayout of the grid I looped over the columns, setting everything to exclude True, wich has current value ExcludeFromColumnChooser.Default.
foreach (UltraGridColumn col in ugBaremaOverview.DisplayLayout.Bands[0].Columns){ if (!col.ExcludeFromColumnChooser.Equals(ExcludeFromColumnChooser.False)) col.ExcludeFromColumnChooser = ExcludeFromColumnChooser.True;
}
Hi,
Hm, I think maybe my memory is playing tricks on me. I remember looking into this issue, but I took a look at our source code and the grid doesn't automatically set ExcludeFromColumnChooser on any columns. So perhaps we decided that this wasn't something the grid can assume automatically.
So your best bet in that case is to handle the InitializeLayout event of the grid and set ExcludeFromColumnChooser on the columns you want to exclude.
Hi Bart,
BartBra said:During the SetDataBinding, I've set hideNewColumns to true, wich hides all unmapped properties. But the column chooser apparently by default doesn't react in the same way.
What version are you using? I think this is a bug that was fixed a while ago. You might just need the latest service release.
How to get the latest service release - Infragistics Community
If it is unbound column, you create it somewhere. Where you create it, set this property. It should work.