如果我有 DataGrid
在我的View
和 Property
在我的ViewModel
表示当前事件的 DataGridRow
(例如,焦点项目或单击项目)我应该将我的属性绑定(bind)到 SelectedItem
或 CurrentItem
.假设我选择将其绑定(bind)到 SelectedItem
, 那么 CurrentItem
是什么为了?我应该将另一个属性绑定(bind)到 CurrentItem
?
最佳答案
看看这个:DataGrid CurrentItem != SelectedItem after reentry with tab-button
First of all a row is selected by the user which makes the datagrid show that row in the selected way (SelectedItem and also CurrentItem contain the selected object). Then the focus is given to another control. In this status - the selection is still shown - SelectedItem is still there while CurrentItem is null!
好文章:http://docs.telerik.com/devtools/silverlight/controls/radgridview/selection/selecteditem-currentitem.html
关于WPF DataGrid 绑定(bind)到 CurrentItem 或 SelectedItem?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30395794/