Gridview rowupdating code behind

Rated 3.88/5 based on 721 customer reviews

Save all or press "Ctrl S" and hit "F5" to run the page, the page will look as in the following image: Click on "Edit the Grid View", it will display Textboxes in each cell as in the following image: Edit the value(s) here and click on the Update link, it will update all the data or to remove it click on the "Delete" link above the image shown.

One note will be helpful for you, while describing Columns in Grid View if you are using a boundfield then create objects of the control using cells[index] in the rowupdateing event of Grid View, but if you are using controls itself like Label or textboxes etc then use Fincontrol("stringid").

The Grid View looks something like this: If you carefully read the HTML code of the Grid View which I have posted above then you will notice one very special thing.In the Row Updating event handler, it fetches the Category Name data to which the textbox is bound to. Try something the gridview is bound to in your case Product [email protected] Vijay : I agree that its bad idea to enable any Id to be editable, but before going to my module i just create one table containing Prod ID and prod Name. Note: Instead of using Text Box in normal mode use Labels. For this I will make the editable Grid View and use the Required Field Validator for the Text Boxes.I will also show you that how you can use validation against the Drop Down List control which is contained inside the Grid View control.

Leave a Reply