Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid bypasses the BusinessRules
Message
From
19/01/2004 14:22:50
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Grid bypasses the BusinessRules
Miscellaneous
Thread ID:
00868254
Message ID:
00868254
Views:
53
Hello All,

How do I enforce the BusinessRules on a mmDataGrid using the UpdateCommand?

I have a priority field on my grid which is used to give priority to the order of the records if they were to be exported into a flat file format. The Priority field is the only field that can be editted on the grid. Valid values range from 1 to 99, where 99 is the default value. The Business rule has been properly set up to fire if 0 is entered. On a normal form the error icon would appear beside a text field or spinner; but the only place to edit this field is in the Grid itself.

The following code is almost exact from the Mere Mortals 1.1 help file. The SaveDataSet does not have an overloaded method returning a business object like the WEB form's Save method.

// Get the item to be updated
this.grdClientFacility.EditItemIndex = e.Item.ItemIndex;
// Retrieve the previous Categories DataSet
DataSet dsWaitingFacility = (DataSet)Session["dsWaitingFacility"];
// Save the DataSet (the DataGrid automatically binds back)
this.oWaitingFacility.SaveDataSet(dsWaitingFacility);
// Reset the edited item and rebind the DataGrid
this.grdClientFacility.EditItemIndex = -1;
this.BindControl(this.grdClientFacility);


Notice the comment line just before the SaveDataSet(). This sounds like it ignores the BusinessRules of the table.
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Next
Reply
Map
View

Click here to load this message in the networking platform