Telerik grid validation lost focus cellvalidating issue

4 posts, 0 answers
  1. Divanshu
    Divanshu avatar
    1 posts
    Member since:
    Nov 2012

    Posted 27 Nov 2012 Link to this post

    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.....

  2. Val
    Val avatar
    5 posts
    Member since:
    Feb 2012

    Posted 22 Jan 2013 Link to this post

    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.
  3. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 23 Jan 2013 Link to this post

    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.

  4. Val
    Val avatar
    5 posts
    Member since:
    Feb 2012

    Posted 25 Jan 2013 Link to this post

    Hi,

    Thank you Didie for your answer.

    Regards
Back to Top