This question is locked. New answers and comments are not allowed.
I am trying to change the a columns background color when a cell within that column is selected. my code is below:
| private void gridImportData_SelectionChanged(object sender, SelectionChangeEventArgs e) { |
| gridImportData.CurrentCell.Column.CellStyle = SelectedColumnStyle; ////gridImportData.CurrentCell.Column.Background = new SolidColorBrush(Colors.Yellow); |
| } |
| <Grid.Resources> |
| <Style x:Name="SelectedColumnStyle" TargetType="GridView:GridViewCell"> |
| <Setter Property="Background" Value="Yellow" /> |
| </Style> |
| <Style x:Name="UnselectedColumnStyle" TargetType="GridView:GridViewCell"> |
| <Setter Property="Background" Value="Transparent" /> |
| </Style> |
| </Grid.Resources> |
This does not change the background color at all. I tried to do it the other way that is commented out in the code example above, this way only changes the color when I scroll or force a 'repaint' in some way of the cells in question. Can you help with this?