I have a scenario where I need to specify functions such as
void SomeFunction(int value)
For this, I use two DataGrid s.
- The left
DataGrid contains functions - The right
DataGrid contains the parameters for the selected function
I want the DataGrid parameter to turn on when a valid function is selected in the DataGrid function. If NewItemPlaceHolder selected (the last row when CanUserAddRows="True" for the DataGrid ), or if the selection is empty, I want it to be disabled. I am experimenting with a DataTrigger, but I could not get it to work
<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>
Is it possible to check if the value created by the binding has a specific Type value? Otherwise, does anyone have any other solutions? I am currently handling this with the SelectedCellsChanged event, but I would prefer not to use the code for
thanks
Fredrik hedblad
source share