Hi - I have two problems I'm trying to solve:
In my MVVM application, I have extended StyleSelector to my own EditStyleSelector.
In the xaml I have this:
<Grid.Resources>
<styles:EditStyleSelector x:Key="MyStyleSelector" />
</Grid.Resources>
...
<telerik:RadGridView x:Name="PermissionGridView"
IsReadOnly="True"
ItemsSource="{Binding ViewList}"
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
CanUserFreezeColumns="False"
RowIndicatorVisibility="Collapsed"
RowDetailsVisibilityMode="Collapsed"
RowStyle="{x:Null}"
AlternateRowStyle ="{x:Null}"
AlternationCount ="0"
AlternateRowBackground ="{x:Null}"
RowStyleSelector="{StaticResource BastStyleSelector}"
Margin="10,10">
I have my own button for deleting rows from the gridview. I am not using the built-in controls. When the Delete button is pressed, the row is marked as deleted in the gridview's underlying viewmodel, but not actually deleted. I just want the row marked for deletion to show up in a different colour. The EditStyleSelector class inspects the row item and returns a different style for each state of the row. Eg: Delete = Red, Edited = Blue, New Row = Green.
This works, after a fashion, but I have two problems.
Problem One: when alternating rows are enabled, my style is overwritten by the alternating row style. Apparently my style is being applied first, then the alternating row style. I can turn off alternating rows, making my style visible, but alternating rows are useful. I would like to have my style applied AFTER the alternating row style. Is this possible?
Problem Two: I don't actually see my style change until I make some other change to the gridview that causes a re-validation(?). A column sort, or adding a new row will refresh the grid, making my style visible. How do I force the gridview to refresh/revalidate/reapply the style after my data changes?
Thanks for any suggestions.
In my MVVM application, I have extended StyleSelector to my own EditStyleSelector.
In the xaml I have this:
<Grid.Resources>
<styles:EditStyleSelector x:Key="MyStyleSelector" />
</Grid.Resources>
...
<telerik:RadGridView x:Name="PermissionGridView"
IsReadOnly="True"
ItemsSource="{Binding ViewList}"
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
CanUserFreezeColumns="False"
RowIndicatorVisibility="Collapsed"
RowDetailsVisibilityMode="Collapsed"
RowStyle="{x:Null}"
AlternateRowStyle ="{x:Null}"
AlternationCount ="0"
AlternateRowBackground ="{x:Null}"
RowStyleSelector="{StaticResource BastStyleSelector}"
Margin="10,10">
I have my own button for deleting rows from the gridview. I am not using the built-in controls. When the Delete button is pressed, the row is marked as deleted in the gridview's underlying viewmodel, but not actually deleted. I just want the row marked for deletion to show up in a different colour. The EditStyleSelector class inspects the row item and returns a different style for each state of the row. Eg: Delete = Red, Edited = Blue, New Row = Green.
This works, after a fashion, but I have two problems.
Problem One: when alternating rows are enabled, my style is overwritten by the alternating row style. Apparently my style is being applied first, then the alternating row style. I can turn off alternating rows, making my style visible, but alternating rows are useful. I would like to have my style applied AFTER the alternating row style. Is this possible?
Problem Two: I don't actually see my style change until I make some other change to the gridview that causes a re-validation(?). A column sort, or adding a new row will refresh the grid, making my style visible. How do I force the gridview to refresh/revalidate/reapply the style after my data changes?
Thanks for any suggestions.