我有一种情况,我需要像DataTrigger对特定类型的
void SomeFunction(int value)
为了这个,我用两个DataGrid
S指定功能。
- 左
DataGrid
保存功能 - 右
DataGrid
适用于所选择的功能
我只想参数DataGrid
当在功能DataGrid
选择一个有效的功能启用参数。如果NewItemPlaceHolder
(最后一行CanUserAddRows="True"
为DataGrid
)被选中,或者如果选择是空的,我希望它被禁用。我experimentet与DataTrigger但我无法得到它的工作
<Style TargetType="DataGrid">
<Setter Property="IsEnabled" Value="False"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=functionDataGrid,
Path=SelectedItem}"
Value="{x:Type systemData:DataRowView}">
<Setter Property="IsEnabled" Value="True"/>
</DataTrigger>
</Style.Triggers>
</Style>
是否可以检查该结合而产生的值是一个特定Type
的?否则,有没有人有任何其他解决方案呢?截至目前,我正在处理这与SelectedCellsChanged
事件,但我不会用背后
感谢
什么是你的新项目的占位符?你是如何实现它的? – 2011-02-23 13:53:57
@Dan Puzey:当'DataGrid'的'CanUserAddRows =“True”'被提交到底层Collection之前,它是“空行” – 2011-02-23 13:57:59