0

Suppose i sorted the gridcontrol from their fields, now i want to get the grid control all rows in a order it is sorted.I am able to get grid all records by using

(gridname.ItemsSource as ICollection).Count

but not able to get in the order it is sorted.

Please help me !

Rahul
  • 5,603
  • 6
  • 34
  • 57

2 Answers2

0

From: How to get the sorted data from gridcontrol

To accomplish this task, you can enumerate all row handles and get data by the GridView.GetRow method. Please refer to the Identifying Rows and Cards help article to get additional information about row handles.

Refer the below that may help to get sorted as accessing the filtered data:
How to get a list of the data rows in a filtered grid

how to get the xtragrid filtered and sorted datasource?

Community
  • 1
  • 1
Niranjan Singh
  • 18,017
  • 2
  • 42
  • 75
0

1.Why you want to get the Sorted collection from the DataGrid when you can sort the Collection itself independent of the grid For example You will be setting the

gridname.ItemSource = myCollection;

You can do orderby on this myCollection by using linq expressions which will give you a sorted list as you need.

2.Sorting from the grid and using that collection will have a performance impact as compared to sorting in a collection.

Tinu
  • 197
  • 2
  • 9