通过DataGridColumn应用时,DataGridCell样式不起作用

时间:2013-02-13 18:57:13

标签: wpf xaml datagrid

以下模板正确显示DataGridCell内容,当它被指定为单个ControlTemplate的{​​{1}}时(在Click事件之后找到):

DataGridCell

但是,如果我在定位<DataTemplate x:Key="gridCellTemplate"> <Border BorderBrush="RoyalBlue" BorderThickness="2" CornerRadius="15"> <ContentPresenter Content="{Binding}" Margin="2,2,2,2" /> </Border> </DataTemplate> 类型的样式中将此模板用作ControlTemplate,并将该样式用作DataGridCell的{​​{1}},则该列单元格的内容显示为CellStyle,这意味着单元格无法从DataGridColumn的匹配元素中提取其正确的内容。

任何人都知道如何为DataRowView正确设置绑定?

0 个答案:

没有答案
相关问题