我想根据我背后的代码中的变量数组动态更新/设置DataGridTextColumn标头. 我背后的代码中.
I want to dynamically update/set the DataGridTextColumn header based on variable array in my code behind.In my code behind.
;私有列表< int>年; 公共列表< int>年份 {得到 {返回年份; } 设置 {年=值; RaisePropertyChanged(年份"); } } 在我的xaml文件中,我有一个数据网格,我想在其中设置列上的标题 < toolkit:DataGrid ItemsSource =" {绑定价格}" AutoGenerateColumns =假"> < toolkit:DataGrid.Columns> &b < toolkit:DataGridTextColumn Binding =< {Binding Gloves}";> &bsp; ; < toolkit:DataGridTextColumn.Header> nbsp; b <标签内容="{绑定年份[0]}"/> ; </toolkit:DataGridTextColumn.Header> b ; </toolkit:DataGridTextColumn> </toolkit:DataGrid.Columns> </toolkit:DataGrid> 似乎不起作用,标题为空(未显示任何内容)-如果我更改Content =" {Binding Years [0]}"" to Content ="2010"然后标题显示2010 有什么建议吗?提前thx
更多推荐
绑定DataGridTextColumn标头
发布评论