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

[Solved] RowValidating question

3 Answers 82 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.
Keith Stephens
Top achievements
Rank 1
Keith Stephens asked on 13 Dec 2010, 04:56 PM
In teh RowValidating event you have e which is
GridViewRowValidatingEventArgs e
 
and with e you have isvalid ect..  How would you set the errormessage if there is an error.  what I am looking for is what the is what the cellvalidating does, with
GridViewCellValidatingEventArgs e)


Thanks,
KS

3 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 13 Dec 2010, 05:09 PM
Hello Keith Stephens,

You may may add GridViewCellValidationResultset its ErrorMessage property and add it to the ValidationResults collection:

void playersGrid_RowValidating(object sender, GridViewRowValidatingEventArgs e)
        {
            GridViewCellValidationResult validationResult = new GridViewCellValidationResult();
 
            validationResult.ErrorMessage = "MyErrorMessage";
            e.ValidationResults.Add(validationResult);
        }

 

Kind regards,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Stephen
Top achievements
Rank 2
answered on 01 Mar 2011, 11:28 AM
How do you clear the validation errors on a RadGridView? On the row there is a little red symbol like a stop sign. 
I am clearing the error in the CellValidating event handler;

this.validationSummary.Errors.Clear();

but the red symbol stays there until the row is revalidated. 
0
Maya
Telerik team
answered on 07 Mar 2011, 03:06 PM
Hello Stephen,

If you want to remove the red 'stop' sign, when the row validation fails, you may predefine the RowStyle and remove the undesired indicator. I am sending you the sample project demonstrating this approach.

 

Kind regards,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
Keith Stephens
Top achievements
Rank 1
Answers by
Maya
Telerik team
Stephen
Top achievements
Rank 2
Share this question
or