我如何使用标签将值存储在datagrid wpf中? [英] how i can use tag to store value in datagrid wpf?
本文介绍了我如何使用标签将值存储在datagrid wpf中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
有谁能帮助我将数字存储在datagrid中每一行的标记中?
can any one help me i want to store number in tag of each row in datagrid?
推荐答案
请澄清您的问题.您要在XAML中还是通过后台代码进行设置?数字是常数还是计算出来的?
Please clarify your problem. Do you want to set it in XAML or via code-behind? Is a number constant or calculated somehow?
在XAML中,您可以使用以下代码设置行的标签:
In XAML you can set Tag of a row with this code:
<DataGrid>
<DataGrid.ItemContainerStyle>
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="Tag"
Value="..."/>
</Style>
</DataGrid.ItemContainerStyle>
</DataGrid>
这篇关于我如何使用标签将值存储在datagrid wpf中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文