Invoke GridViewCellValidating for all cells

2 posts, 0 answers
  1. Abhilash
    Abhilash avatar
    3 posts
    Member since:
    May 2016

    Posted 10 Aug Link to this post

    I am using RadGridView and using CellValidating event to handle errors and display error message:

    private static void GridViewCellValidating(object sender, GridViewCellValidatingEventArgs e)
        var validationText = string.Empty;
        var isValid = true;
        var cell = e.Cell;
         //Some business logic here for to set isValid and validationText based on which column the cell belongs to
        e.ErrorMessage = validationText;
        e.IsValid = isValid;

    The event gets fired when I move away from cell, and is fired for the same cell only from which user moved out.

    I need this event to be fired for all cells in the recently added row as soon as user clicks outside the grid so that all the cell contents are validated.

    Currently since all cells doesn't get validated, user is able to invoke final 'Save' functionality since there is no validation error message.

    Looking forward for your suggestion



  2. Dilyan Traykov
    Dilyan Traykov avatar
    337 posts

    Posted 15 Aug Link to this post

    Hello Abhilash,

    I'm a little uncertain about your exact requirements, but I believe the RowValidating approach should be suitable for this scenario.

    Could you please give it a try and let me know if it works for you? If that is not the case, please provide more details about your exact requirements and I will gladly assist you further.

    Dilyan Traykov
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft banner
Back to Top