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

Selected Row with error style

4 Answers 21 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Karl B
Top achievements
Rank 1
Karl B asked on 12 Mar 2019, 06:23 PM

I want to see which of my invalid grid rows are selected.

Basically I am wanting the same thing as this post - https://www.telerik.com/forums/selected-row-highlighting but I am using the VisualStudio2013 theme and trying to make a similar change didn't fix it.

 

 

4 Answers, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 15 Mar 2019, 11:09 AM
Hello Karl B,

I've prepared a small sample project demonstrating how the desired result can be achieved in the VisualStudio2013 theme.

What I've done is to extract the GridViewRow template and modify the order of the composing elements. More specifically, I've placed the Background_Selected rectangle after the Background_Invalid rectangle and before the PART_IndicatorPresenter border.

In addition, I've introduced the following trigger as the control does not enter the Selected visual state if it has an error:

<Trigger Property="IsSelected" Value="True">
    <Setter TargetName="Background_Selected" Property="Visibility" Value="Visible" />
</Trigger>

Please note that I've made these modifications by using the implicit styles approach. You should, however, be able to use a similar approach if you're using the StyleManager.

Please have a look and let me know if this would work for you.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Karl B
Top achievements
Rank 1
answered on 18 Mar 2019, 02:19 PM

I tried running your solution against our installed version- WPF R2 2017 (!) and I got an error.

Cannot find the static member 'MouseOverBackgroundProperty' on the type 'GridViewRow'. SelectedRow_Validation

App.xaml 239

Does this solution require the newest version? I don't think we have plans to update

0
Accepted
Dilyan Traykov
Telerik team
answered on 19 Mar 2019, 03:41 PM
Hello Karl,

Indeed, the MouseOverBackground property was introduced with our latest service pack (2019.1.220). I have, however, updated the project so that it targets the R2 2017 version of the UI for WPF suite.

Please give this a try and let me know if this updated template works for you.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Karl B
Top achievements
Rank 1
answered on 19 Mar 2019, 05:12 PM
Thanks!
Tags
GridView
Asked by
Karl B
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Karl B
Top achievements
Rank 1
Share this question
or