We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Close Icon
Unfortunately, activation email could not send to your email. Please try again.
Close Icon
close icon
Vote for your favorite ebook
Succinctly Readers Awards 2020
Syncfusion Feedback

Implementing form-level validation using a GGC

Thread ID:





51475 Nov 7,2006 03:06 AM UTC Nov 8,2006 10:08 AM UTC WinForms 1
Tags: Grouping
Michael Lorenz
Asked On November 7, 2006 03:06 AM UTC


My question still has to do with validation. I've looked through all of the examples I could find, and nothing matches what I'm looking for: when the user is done with the form (and the GGC), the user will click on a Save button. When that happens, I need to loop through the visible data in the grid, performing various cross-checks, and highlight all cells that are in error. Here's a code snippet of what I have so far:

foreach( Syncfusion.Grouping.Record groupRecord in this.TableModel.Table.FilteredRecords ) {
DataRowView drv = (DataRowView)groupRecord.GetData();
myRow row = (myRow)drv.Row;
if( this.currentView == ViewToBeTested ) {
if( myRow.IsmyFieldNull() || myRow.myField == 0 ) {
// Error condition here

So, I'm looping through the filtered records, since I *am* using a filter. I cast the grouping record to my underlying data so I can check the fields I'm interested in, and I find an error. Now, how do I mark the corresponding cell in the *grid* as having an error? Specifically: how do I figure out the row and column indices for the cell, and then how do I set the ErrorMessage for that cell so that it's highlighted and has the error icon? Is this even the correct approach, or is there a better way?

Michael Lorenz

Administrator [Syncfusion]
Replied On November 8, 2006 10:08 AM UTC

Hi Michael,

My apologies for the delayed response.

Issue 1 : Draw the Error Icon in a cell.

The TestErrorProvider browser sample shows you how to draw an ErrorProvider-like icon for cell using the IconPaint class. Also refer to the below forum thread for customizing the ErrorIcon.

Issue 2: Find the RowIndex of the record.

Please refer to below Evalution Center link(=>GroupingGrid category) for more details.

Best Regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon