DevExpress中获取GridControl排序之后的List
生活随笔
收集整理的這篇文章主要介紹了
DevExpress中获取GridControl排序之后的List
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1 public System.Collections.IList GetGridViewFilteredAndSortedData(DevExpress.XtraGrid.Views.Grid.GridView view)
2 {
3 return view.DataController.GetAllFilteredAndSortedRows();
4 }
由于Dev排序只是在UI界面顯示界面由控件更改排序,綁定的數據源順序不會發生改變,所以要用上面的方法獲取排序之后的界面,然后去遍歷。
private int GetRowIndex(System.Collections.IList list,DataRow drow){//當前數據行實時索引int rowin = 0;string str = drow["OBJECTID"].ToString(); int i = 0;foreach (var ss in list){if (((System.Data.DataRowView)ss).Row.ItemArray[0].ToString() == str){rowin = i;return rowin;}i++;}return rowin;}?根據行數據獲取該行在排序之后的索引值。
轉載于:https://www.cnblogs.com/JeepH/p/9110766.html
總結
以上是生活随笔為你收集整理的DevExpress中获取GridControl排序之后的List的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 小数据池,字典
- 下一篇: Python-WSGI协议如何实现?