Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

sorting data

c#

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 alexandarx5

alexandarx5

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 18 May 2016 - 10:28 PM

how can a programmer using dapfor wpf gridcontrol sort data by column used for grouping.



#2 pedro123

pedro123

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 19 May 2016 - 11:37 AM

how can a programmer using dapfor wpf gridcontrol sort data by column used for grouping.

 

Here is how a programmer can do it.

C#

Header header = grid.Headers[0];

Column column1 = header["Column1"];

Column column2 = header["Column2"];

 

//Sort by the first column

column1.SortDirection = SortDirection.Ascending;

 

//Turn on the multiple sort by the second column

column2.SortDirection = SortDirection.Descending;

 

//Enumerate all sorted columns

foreach (Column column in header.SortedColumns)

{

    //Some code here...

}

 

//Clear the sort

header.SortedColumns.Clear();