RadGridView error template on selected row

0 Answers 68 Views
GridView
alex
Top achievements
Rank 2
Bronze
Iron
Iron
alex asked on 24 Nov 2022, 04:24 AM

Hello,

I have a RadGridView with a model that may have some errors. In case of error, the row border is red and the row background is transparent. In this case, when having many rows with errors, the user can't know which row is selected because the blue background which indicates that the row is selected, dissapears on error.

How can I fix the Error Template to show also the error red border and the IsSelected blue background?

Dilyan Traykov
Telerik team
commented on 28 Nov 2022, 11:10 AM

Hello Alex,

Can you please specify which theme and validation mechanism (via events or interfaces) you are using? 

If possible, please send over a small sample project which demonstrates your setup so that I can try to suggest a solution, tailored to your particular scenario.

Thank you in advance for your cooperation on the matter. I will be awaiting your reply.

alex
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 28 Nov 2022, 04:55 PM | edited

Hello.  My regular error template is from MahApss.

Please take a look at the following example:

https://user-images.githubusercontent.com/20015538/45148768-52786e80-b1c8-11e8-822d-d64cf5478c0e.png

Nevertheless, I am talking about the RadGridView, not a TexrBlock. We are using the StyleManager with theme VisialStudio 2013 but my team updated some of the default styles. Could you share an example of en Error Template for the GridViewRow which put a red border and keeps the blue fill for selected rows?

I can't understand why the style with error doesn't show the row selection. I am not allowed to share our code and create a demo with our custom styles is very complicated. Maybe do you have a test project that already hage a similar template??

The validation mechanism is less relevant because the error template is shown, just not the way I want.

 

Dilyan Traykov
Telerik team
commented on 30 Nov 2022, 12:02 PM

Hello Alex,

Thank you for the clarification.

I've gone ahead and prepared a small sample project to demonstrate how you can display the blue background for the selection in the VisualStudio2013 theme by adding an additional control template trigger:

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

Can you please have a look and let me know if a similar modification also works at you end?

alex
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 10 Jan 2023, 04:13 AM | edited

Thank you.

I need to show the error and selection which means blue background and red border. I made a different trigger.

Is your code doing the same?

Dilyan Traykov
Telerik team
commented on 10 Jan 2023, 11:14 AM

Hi alex,

Here's the result that can be observed with the sample project when applying the Trigger I shared above:

Nonetheless, if you've managed to achieve the same result with a different trigger, you can still use that as long as it provides the expected functionality.

No answers yet. Maybe you can help?

Tags
GridView
Asked by
alex
Top achievements
Rank 2
Bronze
Iron
Iron
Share this question
or