CustomValidator and Gridview problem
-
I have a customvalidator for textbox' in a gridview. The problem is, it doesn't fire up. I did put a break point to validation method but it never catches. The code is working fine in a single page with a single textbox but not in a GridView Can you please tell me what's wrong? Here's my code: private void NumericControl(object sender, ServerValidateEventArgs args) { if (Tools.IsNumeric(args.Value)) args.IsValid = true; else args.IsValid = false; }
-
I have a customvalidator for textbox' in a gridview. The problem is, it doesn't fire up. I did put a break point to validation method but it never catches. The code is working fine in a single page with a single textbox but not in a GridView Can you please tell me what's wrong? Here's my code: private void NumericControl(object sender, ServerValidateEventArgs args) { if (Tools.IsNumeric(args.Value)) args.IsValid = true; else args.IsValid = false; }
-
Check if your button has CausesValidation = true and the ValidationGroup = "Kontor"; And Set the ValidationGroup="Kontor" for the TextBox EG
-
I have a customvalidator for textbox' in a gridview. The problem is, it doesn't fire up. I did put a break point to validation method but it never catches. The code is working fine in a single page with a single textbox but not in a GridView Can you please tell me what's wrong? Here's my code: private void NumericControl(object sender, ServerValidateEventArgs args) { if (Tools.IsNumeric(args.Value)) args.IsValid = true; else args.IsValid = false; }
Check these articles out on validating controls in gridview http://www.eggheadcafe.com/software/aspnet/31834970/customvalidator-in-gridvi.aspx http://www.aspdotnetcodes.com/GridView_Dynamic_Validation.aspx
-
Check these articles out on validating controls in gridview http://www.eggheadcafe.com/software/aspnet/31834970/customvalidator-in-gridvi.aspx http://www.aspdotnetcodes.com/GridView_Dynamic_Validation.aspx
-
Dynamically adding customvalidator during runtime instead of adding in itemtemplate somehow solved my problem. Thanks for the links. http://www.aspdotnetcodes.com/GridView_Dynamic_Validation.aspx[^]