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

Telerik grid validation lost focus cellvalidating issue

3 Answers 139 Views
Telerik Trainer
This is a migrated thread and some comments may be shown as answers.
Divanshu
Top achievements
Rank 1
Divanshu asked on 27 Nov 2012, 06:52 PM

hi,

i m using silverlight and telerik radgrid....now i m validationg a certail cell......i m using mandatory validation for the cell..

i m using rowvalidating and cellvalidating events......

Problem is that, on displaying the error message (i m using red border for indicating the mandatory field missing message).......

the focus retains on that cell only...it doesnt move to any other part of the page...neither mouse works nor the keyboard.....please help guys...

i m also playing with the e.IsValid, ActionOnLostFocus properties........but i guess i m missing the right order...

need the help urgently.....

if possible please provide sample codes (well arranged and to the point)

thanks in advance.....

3 Answers, 1 is accepted

Sort by
0
Val
Top achievements
Rank 1
answered on 22 Jan 2013, 04:27 PM
Up.
I have the same problem. I use the escape key to lose the focus on the cell. Is there another solution ?

Thanks in advance.
0
Dimitrina
Telerik team
answered on 23 Jan 2013, 01:37 PM
Hello,

Your requirement cannot be done on a cell level as only one cell can be in edit mode state at a time. As you have set the cell to be invalid, it cannot be committed so that you cannot go out of that cell.

I can suggest you to try a similar approach when the RowValidating event is raised:

private void clubsGrid_RowValidating(object sender, GridViewRowValidatingEventArgs e)
{
    e.IsValid = false;
    GridViewCellValidationResult result = new GridViewCellValidationResult();
    result.ErrorMessage = "error message";
    result.PropertyName = "Name";
    e.ValidationResults.Add(result);
}

You should as well set the ValidatesOnDataErrors="InViewMode" for the RadGridView.

I hope this works for you.
Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Val
Top achievements
Rank 1
answered on 25 Jan 2013, 04:25 PM
Hi,

Thank you Didie for your answer.

Regards
Tags
Telerik Trainer
Asked by
Divanshu
Top achievements
Rank 1
Answers by
Val
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or