Validations attibutes are not getting applied when addin new row
Is there any way to do this?
Hi,
Validation should occur in the AddNewRow exactly like it does for a normal data row. Perhaps, you're passing in a different data object in the DataObjectRequested event that doesn't have the validation attributes?
-SteveZ
Does it differ if the values are dropdowns and the valueid exists in main table and the detailname exists in other table?
Any solution for this?
How to resolve this "Validation occurs after the RowAdding event, thus, b/c you're canceling the add, no validation occurs..."
I think the attributes if it is integer/decimal value have to be given as [Range(typeof(...)...]
So i gave this for my combo's id and it works.
But the row gets added inspite of the values not entered and the error message is getting displayed after the newly added row is getting added to grid
It does not display when its add new row
Any pointers
Yes the sample is same for add row but the original one has combo
The validation occurs for textboxes(i.e if i give [Required] attribute for the controls that are textboxes but not for the combo
If this is for the same application as your last question about RowAdded not firing, then the same thing applies.
Validation occurs after the RowAdding event, thus, b/c you're canceling the add, no validation occurs.