Gridview updating event in asp net

This collection only requires the row index no and it will give us the primary key.

Last line of the following code is calling a local method for updating the database and passing all the parameters to this method.

You can preview the data returned by this new data source by clicking Test Query button. After the configuring Sql Data Source using above mentioned steps, drag and drop the Grid View control onto the page.

All other database operations have to be coded manually.

You can also customize the look and feel of each page by setting various properties like Pager Style property and using Pager Template to change look and style of buttons and pages.

You can see properties of Grid View1 in below listing Another striking difference between Data Grid and Grid View is in the event model.

This way you can get a chance to inspect the input values just before the event is fired and evaluate the returned results just after the event is fired.

Similarly for Delete operation, Grid View supports Row Deleting(pre-event) and Row Deleted events(post-event).

Leave a Reply