Change Foreground color of GridViewCheckboxcolumn

4 posts, 0 answers
  1. crazy05
    crazy05 avatar
    72 posts
    Member since:
    Sep 2014

    Posted 26 May 2015 Link to this post

    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>

  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 27 May 2015 Link to this post

    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
  3. DevCraft banner
  4. crazy05
    crazy05 avatar
    72 posts
    Member since:
    Sep 2014

    Posted 27 May 2015 Link to this post

    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 ?

  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 28 May 2015 Link to this post

    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
Back to Top