Hi,
I am trying to generated GroupColumns dynamically, so would like to know if there is any way that I can bind a list or something to GroupColumns, so that n number of group columns can be created on the fly.
A sample would be highly appreciated. FYI - I would like to achieve this thing only through xaml and no code behind.
Thanks,
Sunil
Hi Stefan,
Thanks for the quick reply. When I say GroupColumns, I didn't mean grouping but banding which is a new feature in WPF xamGrid.For example:
<ig:XamGrid x:Name="dataGrid" AutoGenerateColumns="False"> <ig:XamGrid.Columns> <ig:GroupColumn Key="Group1"> <ig:GroupColumn.Columns> <ig:TextColumn Key="Name"/> <ig:TextColumn Key="Location"/> </ig:GroupColumn.Columns> </ig:GroupColumn> </ig:XamGrid.Columns></ig:XamGrid>
In the above code, I have declared one groupColumn and two text columns in it. However, in my case the number of groupColumns are dynamic, so I need to have a way to bind the GroupColumn key with a collection or something. Please could you suggest a way to accomplish this thing using xaml (with MVVM i.e. no code behind).
Hello Sunil,
Thank you for your post. I have been looking into it and I can say that since the XamGrid’s GrouBySettings’ GroupedColumns Collection is read only and cannot be set, you are only allowed to add items to it. Here it is explained how to group columns via code:
http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=xamGrid_GroupBy.html
Hope this helps you.