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

cell and row validation - urgent

1 Answer 126 Views
GridView
This is a migrated thread and some comments may be shown as answers.
seb
Top achievements
Rank 1
seb asked on 29 Jun 2011, 11:00 PM
We have a gridview and are having a problem validating cells.  Problem is this:  the first cell is valid, but the second is not valid.  When the user changes the current row and then clicks away with their mouse, the focus returns to the first cell, but I want it to go to the second cell, so that the user can enter a correct value.  How can I make the focus go to the invalid cell, not to the cell the user mouse-clicked out of?   

Thank you. 

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 30 Jun 2011, 12:41 PM
Hello Seb,

Thank you for your question.

From the description of your scenario I assume that you use the RowValidating event of RadGridView. I would suggest using the CellValidating event to accomplish this case. Cancelling this event, when the provided from the user value is not valid, will prevent the user from leaving this cell.

You can find an example for using CellValidating event and an additional description of the RadGridView validation mechanism in this help article.

I hope it helps you accomplish your scenario.

Best regards,
Alexander
the Telerik team
Registration for Q2 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting July 18th and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
seb
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or