Monday, March 26, 2012

Validation

Hello all,

I have 2 databound grid views, one with header data and one with the detail. I have selected the option to edit the detail. How do i validate that the field I am going to update? Any help is greatly appriciated.

stwenter

Sorry, what I meant was, how do I validate the field I am editing?


Try doing your validation in the edit event.
You replace a BoundColumn with a TemplateColumn that contains a textbox for the data you want and the desired validators. On the server side, in the post back event to save the row, test Page.IsValid for true before saving.

I am sorry I just realized I didn't specify what version I was working with. Vs 2005. I will try to change the databound column shortly thanks for the replys.

stwenter


I changed the databound column to a template column and added a validator. If I set the textboxt to cause validation and set the validator up correctly should it work or do I need to add the Page.IsValid still.
Yes! Thank you! It works wonderfully, just the way I have wanted it to for awhile now. Thanks

No comments:

Post a Comment