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.
Unfortunately, activation email could not send to your email. Please try again.

Implementing form-level validation using a GGC

Thread ID:

Created:

Updated:

Platform:

Replies:

51475 Nov 6,2006 10:06 PM Nov 8,2006 05:08 AM Windows Forms 1
loading
Tags: Grouping
Michael Lorenz
Asked On November 6, 2006 10:06 PM

Hi,

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?

Thanks,
Michael Lorenz

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

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.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=46953

Issue 2: Find the RowIndex of the record.

Please refer to below Evalution Center link(=>GroupingGrid category) for more details.
http://www.syncfusion.com/support/evalcenter/default.aspx?cNode=5

Best Regards,
Haneef

CONFIRMATION

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.

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.

;