我已将列的displayindex绑定到我的datacontext中的整数变量(DisplayIndex_Name)。C#wpf正确绑定datagrid列的DisplayIndex属性的方法
XAML代码:
<DataGridTextColumn Header="Name" DisplayIndex="{Binding Path=DisplayIndex_Name}" />
在我的数据网格的列的位置现在等于存储在DisplayIndex_Name值。
(如果我设置为0,这将显示为我的第一列)
问题是,当我有多个列,如果我改变了他们的1的DisplayIndex,所有其他displayindexes获得自更新每列都必须具有唯一的值。
现在,这意味着,的DisplayIndex!=其所应绑定的整数值..
任何想法,我怎么能在我的DataContext更新我的变量到的DisplayIndex的精确值?
基本上我只想让用户决定我的列的显示索引,有什么建议吗? – Enrico 2013-05-07 07:15:23