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

Change Foreground color of GridViewCheckboxcolumn

3 Answers 151 Views
GridView
This is a migrated thread and some comments may be shown as answers.
crazy05
Top achievements
Rank 1
crazy05 asked on 26 May 2015, 03:25 PM

Hello,

Below is my GridViewCheckBoxColumn. I want to change the foreground to Yellow if user checks it and back to normal when user unchecks it.

How can I do this using MVVM ? 

<telerik:GridViewCheckBoxColumn Header="Delete" Width="60" DataMemberBinding="{Binding IsDeleted, Mode=TwoWay}" AutoSelectOnEdit="True" EditTriggers="CellClick">
</telerik:GridViewCheckBoxColumn>

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 27 May 2015, 07:39 AM
Hello,

In order to apply conditional styling, I can suggest you applying a CellStyleSelector. You can also check the CellStyleSelector online demo. 

Regards,
Dimitrina
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
crazy05
Top achievements
Rank 1
answered on 27 May 2015, 06:31 PM

I am able to implement CellStyleSelector on GridViewDataColumn but not working in GridViewCheckBoxColumn.

Can you give me an example to change the color of the CheckboxCell on check/uncheck ?

0
Dimitrina
Telerik team
answered on 28 May 2015, 08:48 AM
Hello,

How have you defined the CellStyleSelector at your side? Do you return styles similar to:
<Style TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
  <Setter Property="Background" Value="Yellow" />
</Style>

Regards,
Dimitrina
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
crazy05
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
crazy05
Top achievements
Rank 1
Share this question
or