Jump to content
Software FX Community

Gridfx validations


canurao

Recommended Posts

I need to perform validations against database. If row exists then it should populate error. For this i have used "ValidatingFieldInput" event. For insert it is working fine. When i am trying to update the then this validation is fired and always returns error message. Can any one tell me how to avoid this problem. Here is the sample code i am using this validation need to execute for insert and update (only if old vale and new value is not same)

protected void grdAssetTypes_ValidatingFieldInput(object sender, FieldInputValidationEventArgs e)

{

if (e.Field.DataPath == "AT_str_AssetType")

{

dsATAR.ATAR_AssetTypesRow ARow = null;ARow = AtarAssetDT.FindByAT_str_AssetType(e.InputValue.ToString());if (ARow != null)

{

e.ErrorMessage = "Error: Asset Type Exists";e.IsValid = false;

}

}

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...