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

Grid View Cell Error Tooltip

4 Answers 327 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gord
Top achievements
Rank 1
Gord asked on 06 Apr 2016, 01:35 PM

Hello,

I am trying to set up a WPF RadGridView with cell validation.  I have bound the "CellValidating" event, and within it, when data fails a check, I set the "ev.ErrorMessage" to the message I want displayed, and set "ev.IsValid" to false.  This marks the input element with a red border and a little triangle in the upper right corner.  When mousing over the triangle, it shows the tooltip. 

What I want is for that tooltip to remain shown at all times the same way that the errors are displayed when an exception is thrown while parsing data.  Is there a way of achieving this? 

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 07 Apr 2016, 07:23 AM
Hello Gord,

Please take a look at the Support for "ValidatesOnExceptions" in RadGridView forum thread and more specifically on the ValidationBox_AlwaysVisible project. Let me know whether this corresponds to the behavior that you expect.

Regards,
Maya
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Gord
Top achievements
Rank 1
answered on 07 Apr 2016, 12:13 PM

Hello Maya,

That is the functionality I want, however, it doesn't appear to work in WPF.  The project works as desired in Silverlight, but when I try to port that code over to WPF, it doesn't work.  I had to update one section <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible"/> and change the "Value" attribute to "{x:Static Visibility.Visible}" to fix a compile error, but even after that, the tooltip does not appear at all now.

I did some further fiddling. I have a custom "AdornedElement" object that I can embed into content.  In the template, I wrapped the "<Border...><TextBlock ... errormessage... ></Border>" block inside an "<AdornedElementPlaceholder>" (the custom adorner object) and now I can see the red box but its content is BEHIND all the other cells and controls within that row.  So it looks like the reason that the error message isn't showing, is because it's attached to the grid cell, rather than the grid view itself.

0
Maya
Telerik team
answered on 12 Apr 2016, 06:49 AM
Hi Gord,

Could you check out this forum thread to verify whether the projects attached there would be of more help?

Regards,
Maya
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Gord
Top achievements
Rank 1
answered on 13 Apr 2016, 04:09 PM

Hello Maya,

Yep, that thread did the trick.

Looks like my google-fu was a bit weak.  I never found that page while searching for possible solutions. 

Thanks again for the help. 

Tags
GridView
Asked by
Gord
Top achievements
Rank 1
Answers by
Maya
Telerik team
Gord
Top achievements
Rank 1
Share this question
or