There is a grid
<DataGrid ItemsSource="{Binding Path=MyObservableCollection, Mode=OneWay}" SelectionMode="Extended" IsReadOnly="True" CanUserAddRows="False" CanUserDeleteRows="False" AutoGenerateColumns="False" SelectedItem="{Binding Path=SelectedValue, Mode=OneWayToSource}"> <DataGrid.Columns> <DataGridTextColumn Header="Name" Binding="{Binding Name, Mode=OneWay}" Width="40*"/> <DataGridTextColumn Header="Type" Binding="{Binding TypeText, Mode=OneWay}" Width="10*" /> </DataGrid.Columns> <DataGrid.RowStyle> <Style TargetType="DataGridRow"> <Setter Property="IsHitTestVisible" Value="true или false"/> </Style> </DataGrid.RowStyle> </DataGrid> I want to, depending on the ReadOnly property in the MyObservableCollection collection, the rows become non-separable, the remaining rows can be selected. Is it possible to do this and how?
Collection type:
public class MyType { public string Name {get; set;} public string TypeText {get; set;} public bool ReadOnly {get; set;} }