Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid bypasses the BusinessRules
Message
De
21/01/2004 14:57:08
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00868254
Message ID:
00869185
Vues:
19
I have modified the UpdateCommand code to look as follows:

// 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)
if (this.Save(this.oWaitingFacility, dsWaitingFacility, this.oWaitingFacility.TableName) == mmSaveDataResult.RulesPassed)
{
// Reset the edited item and rebind the DataGrid
this.grdClientFacility.EditItemIndex = -1;
}
else
{
this.grdClientFacility.EditItemIndex = e.Item.ItemIndex;
}
this.BindControl(this.grdClientFacility);


The code will maintain the edit mode on the current record. But the error icon does not appear beside the grid, nor in the column heading (if that is where I should expect it.) The message at the top of the web form does appear, telling the user to look for the icons.

The error should connect to the object named "Priority". The rule is shown below.

How can I have the error icon appear beside the grid or column?

public string ValidatePriority(int Priority)
{
string message = null;

if (Priority == 0)
{
message = "The Priority must be greater than 0.";
this.AddErrorProviderBrokenRule("Priority",message);
}
return message;
}
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform