foreach (GridViewDataRowInfo row in re_ItemregiView.Rows)
{
//
}
The gridview data sorted by clicking on the Gridview header. the data from the source above will have the same content but in a different order.
I want to get an ordered sequence of data on the source.
3 Answers, 1 is accepted
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 12 Jan 2018, 11:08 AM
Hello, SeungHak,
Thank you for writing.
RadGridView exposes two collections that contain data rows:
- Rows - contains all data rows that belong to RadGridView. Data operations such as grouping, sorting, filtering, etc. do not change the content of the collection or the order in which the row objects exist in the collection.
- ChildRows - returns the data rows that are currently represented by RadGridView in the order in which they appear. The collection is modified every time a data operation (grouping, sorting, filtering) occurs.
It is suitable to use the ChildRows collection in your case.
I hope this information helps. Should you have further questions I would be glad to help.
When sorting by clicking the header in gridview, the numbers are not aligned correctly.
For example
10
100
20
200
What I want
10
20
100
200
help me T.T
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Jan 2018, 09:39 AM
Hello, SeungHak,
Thank you for writing back.
It seems that you have string data in the column. That is why the cells are ordered alphabetically. It is recommended to use numeric values where they will be ordered by their values in the GridViewDecimalColumn. Alternatively, you can use the custom sorting functionality that RadGridView supports. Thus, you will have full control over the sorting behavior. Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/gridview/sorting/custom-sorting
I hope this information helps. If you have any additional questions, please let me know.