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

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

2 Answers 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ytnytn1
Top achievements
Rank 1
ytnytn1 asked on 14 Mar 2017, 12:18 PM

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 Answers, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 17 Mar 2017, 09:23 AM
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 you to write beautiful native mobile apps using a single shared C# codebase.
0
ytnytn1
Top achievements
Rank 1
answered on 18 Mar 2017, 02:13 AM
Thank you!
Tags
General Discussions
Asked by
ytnytn1
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
ytnytn1
Top achievements
Rank 1
Share this question
or