Change GridView Row background when row is selected and validation is failed

3 posts, 0 answers
  1. ytnytn1
    ytnytn1 avatar
    7 posts
    Member since:
    Apr 2016

    Posted 14 Mar Link to this post

    Hello Telerik team! 

    When the row validation is failed row background is red and this is ok. But when I select this row it's background is still red. I'm trying to change this behaviour using trigger. But this trigger has no effect. What am I doing wrong. Could you help me, please.

        <Style.Triggers>
       <MultiTrigger>
          <MultiTrigger.Conditions>
            <Condition Property="IsValid" Value="false"/>
            <Condition Property="IsSelected" Value="true"/>
          </MultiTrigger.Conditions>
          <MultiTrigger.Setters>
            <Setter Property="Background" Value="Blue"/>
          </MultiTrigger.Setters>
        </MultiTrigger>

     </Style.Triggers>


  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    483 posts

    Posted 17 Mar Link to this post

    Hi ,

    Actually, the background of the row is changed but the validation border is over it so you do not achieve the behavior you seek for. The red validation border is applied through a Storyboard which can be found in the Control Template of the GridViewRow. With this in mind, you need to edit the control template of the GridViewRow and apply the changes there. You can investigate the control template of the row and work with the visibility of the Background_Invalid border to achieve the desired behavior.

    Regards,
    Stefan Nenchev
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. ytnytn1
    ytnytn1 avatar
    7 posts
    Member since:
    Apr 2016

    Posted 17 Mar Link to this post

    Thank you!
Back to Top