This is a migrated thread and some comments may be shown as answers.

Change Column On Selected Cell Change

1 Answer 25 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ari Perlstein
Top achievements
Rank 1
Ari Perlstein asked on 25 Mar 2010, 02:31 AM
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?
 

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 25 Mar 2010, 10:01 AM
Hi Ari Perlstein,

I have tried to resemble your scenario in the attached project. Please have a look and let me know if you need further assistance.

Best wishes,
Pavel Pavlov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Ari Perlstein
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or