我有自己的 DataGrid
组件(从 DataGrid
继承而来)。我希望这个组件像 MS Access 网格一样运作。我需要的是在调用方法 MySort()
(MyDataGrid.MySort)
时对数据进行一次排序。
MySort
方法使用 DataGrid
的项集合,所以我向 Items
和 View Sorts
添加了 SortDescription
。问题是,我不希望在添加或编辑项目时重新对这个网格进行排序。排序只能由 MySort
方法调用。
如何防止 DataGrid
在 Items.SortDescription
有值时进行排序? 我需要像 do_not_resort
这样的属性。