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

Programmatic Multi_Col Grouping Problem

1 Answer 28 Views
GridView
This is a migrated thread and some comments may be shown as answers.
stephen
Top achievements
Rank 1
stephen asked on 07 Dec 2010, 04:46 AM
hey! guys:
 I created a datatable by code and set it to gridView's itemsource, everything looks good ,I could grouping cols my drag it to group panel.
then I created a button, in button's behind code, I created some group descriptors and added them into grid's group descriptors, Oops,
the problem is coming , the grid is not grouped as I expected, some rows were missing. 
  After I deleted the group cols by closing the grouping button and drag cols into group panel, the group is ok again.
GroupDescriptor descriptor1 = new GroupDescriptor();
descriptor1.Member = "Country";
descriptor1.SortDirection = ListSortDirection.Ascending;
this.gridView.GroupDescriptors.Add(descriptor1) ;
 
GroupDescriptor descriptor2 = new GroupDescriptor();
descriptor2.Member = "Name";
descriptor2.SortDirection = ListSortDirection.Ascending;
this.gridView.GroupDescriptors.Add(descriptor2) ;
The codes is same as demo. Did I miss something ?

1 Answer, 1 is accepted

Sort by
0
stephen
Top achievements
Rank 1
answered on 07 Dec 2010, 06:55 AM
Resolved myself, just because I missed something.
            GroupDescriptor descriptor = new GroupDescriptor();
            descriptor.Member = "ContactName";
            descriptor.SortDirection = ListSortDirection.Ascending;
            descriptor.DisplayContent = "ContactName";
            descriptor.MemberType = typeof(string);
           // this.gvList.GroupDescriptors.Add(descriptor);
descriptor.MemberType = typeof(string);
Tags
GridView
Asked by
stephen
Top achievements
Rank 1
Answers by
stephen
Top achievements
Rank 1
Share this question
or