[我一直在寻找一种在<GridViewColumn>
中创建可编辑单元格的方法,并且找到的参考文献为<GridViewColumn.CellTemplate>
,但是当我尝试使用此方法时,却出现了错误Error XLS0415 The attachable property 'CellTemplate' was not found in type 'GridViewColumn'. Test MainWindow.xaml 26
,并且我已经找到了没有其他潜在的解决方案。我需要一个可编辑的TextBox以及一个可编辑的DatePicker。
CellTemplate
没有可附加的属性,但通过使用找到了解决方案
<DataTemplate x:Key="TextCell">
<TextBox Text={Binding [DataName]}"/>
</DataTemplate>
<DataTemplate x:Key="DateCell">
<DatePicker Text{Binding [OtherDataName]}"/>
</DataTemplate>