Gridview rowupdating example asp net
NET 2.0 Grid View control allows us to quickly edit and delete records. Drag and drop an SQL Data Source control on the web form.However, most of the real world cases call for validating the data being edited or deleted. Open its smart tag and choose “Configure Data Source” option to start Configure Data Source wizard.Next Select your database and Set “Save Entity connection string in Web.config as” option true giving name Sample Entities.Select Both Category and Customer tables Give Model Namespace and click on Finish. NET Gridview Footer row for inserting record, inbuilt way to edit and delete records.Next, drag and drop a Required Field Validation control below the Text Box.Set the Control To Validate property of Required Field Validator control to Text Box1 (i.e. Also, set its Error Message property to “Please enter company name”.This tells Grid View that the event handler should be cancelled.
Right click on the Grid View and select “End template editing” Run the web form.You can not attach validation controls directly to these Text Boxes.We need to convert these Bound Fields to Template Fields.We check the value entered in the Text Box using args. Especially the following events are important for validation point of view.