Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Datagridview validation
Message
 
To
06/09/2006 10:48:42
Jeff Corder
Ambit Technologies, LLC
Missouri, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01150920
Message ID:
01151559
Views:
40
Jeff,

>That makes perfect sense. The Validation is just looking at one record. I made the changes, now the next problem is that when an error occurs, it is always reported in the first row.

Oops...I left out that one detail. Here's the modified code that sets the CurrentRow property:
public override bool CheckRulesHook(DataSet ds, string tableName)
{
	if (ds.Tables[tableName].Rows.Count > 0)
	{
		this.CurrentRow = 0;
		foreach (DataRow Row in ds.Tables[tableName].Rows)
		{		
			OrdersEntity Entity = new OrdersEntity();
			Entity.SetDataRow(Row);

			// Call validation methods
			this.ValidateCustomerID(Entity.CustomerID);
			this.ValidateShipName(Entity.ShipName);
			this.CurrentRow++;
		}
	}

	// Change this return value to indicate result of rule checking
	return this.ErrorProviderBrokenRuleCount == 0;
}
The CurrentRow property is used by mmBusinessRule to set the error row.
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform