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

Validation result is not visible

1 Answer 102 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Berthold
Top achievements
Rank 1
Berthold asked on 16 Dec 2010, 01:35 PM
Hi,
we are working with a GridView with lot's of columns. 
When we are validating data, sometimes there are validation errors in columns which are not visible (too far on the right side).
In this case the whole line is not marked as a line with errors (background is white instead of red)
After scrolling right the background of the whole line becomes red, after a column with validation errors becomes visible

Is there a way to prevent this behaviour?

Thanks
Berthold

1 Answer, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 22 Dec 2010, 08:21 AM
Hello Berthold,

Sorry for the delay.

Indeed this behavior is expected, since due to UI virtualization created cells are only these that are visible on the screen and last one from every row (used for some keyboard navigation purposes). Therefore if some error occurs for "invisible" cell there is no object which could accept error message.
You can by-pass this behavior with generally two approaches.
1. Use RowStyleSelector feature and a property which will hold info about errors (there is such property in INotifyDataErrorInfo interface (HasErrors) ) - recommended approach.
2. Turn off UI Virtualization both for columns and rows.

I'm attaching a sample project that demonstrates the recommended approach. How to use the example:
1. Select any row.
2. Click on button "Set Error".
Selected row should be marked RED.

Keep in mind that this will work only for visible rows. So you could change RadGridView background if any error occurs.
Let me know if this doesn't help.

Best wishes,
Nedyalko Nikolov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
Berthold
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Share this question
or