This is a migrated thread and some comments may be shown as answers.

GridViewDataColumn with codebehind grouping

0 Answers 88 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andras
Top achievements
Rank 1
Andras asked on 10 Apr 2012, 10:16 AM

I had to create a custom column generator with additional logic. It uses reflection to retrieve information about required fields and generates columns.

var gridColumn = new Telerik.Windows.Controls.GridViewDataColumn { 
    Header = attributes[0].Header, IsVisible = attributes[0].IsVisible,
    UniqueName = property.Name,
    DataMemberBinding = new Binding(string.Format("Item.{0}", property.Name)),
}
It works perfectly except grouping and sorting. However I turned on, that user can sort, and the
grid is groupable and sortable.
this.InternalGrid.GroupDescriptors.Add(new Telerik.Windows.Controls.GridView.ColumnGroupDescriptor()  
{ Column = this.InternalGrid.Columns[1] });


Grouping seems to be working, it adds the correct column to the group panel, however there is only one group
which contains all of the rows. Sorting is working alike, indicator shows the correct sorting option but nothing
happens. What am I missing here?

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Andras
Top achievements
Rank 1
Share this question
or