WPF DataGrid 绑定(bind)到 CurrentItem 或 SelectedItem?

标签 wpf data-binding datagrid

如果我有 DataGrid在我的ViewProperty在我的ViewModel表示当前事件的 DataGridRow (例如,焦点项目或单击项目)我应该将我的属性绑定(bind)到 SelectedItemCurrentItem .假设我选择将其绑定(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/

相关文章:

c# - WPF 中的高级效果?

wpf - 固定包裹面板 wpf

wpf - 一次更新 UserControl 中的所有绑定(bind)

c# - 绑定(bind)到 WPF 中的 TreeView

c# - DataTempleSelector 不调用 SelectTemplate

wpf - WPF 中的数据网格

c# - 如何在 WPF DataGrid 上设置边框边距?

silverlight-3.0 - 嵌套 Silverlight Datagrid - 行详细信息效果很好,但我想要一个按钮!

javascript - 使用 applyBindingsToNode 从元素绑定(bind)调用 viewmodel 函数失败

c# - 我应该使用单个 DataGrid、多个 DataGrid 还是完全不同的东西?