The example shown here is for a Grid View, but the same types of event handlers must be implemented in roughly the same way for other data controls including the Form View, Details View, and List View. This is the final Grid View markup, so you can see the event handlers we’re going to implement.
We’ll start with binding data to the Grid View, then build up functionality from there.
We're a friendly computing community, bustling with knowledgeable members to help solve your tech questions.
Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free.
We’re using Linq to SQL to pull data from our database and bind it to the Grid View.The Grid View 'Grid View1' fired event Page Index Changing which wasn't handled.The Grid View 'Grid View1' fired event Sorting which wasn't handled.I am using Template Field’s Item Template and Edit Item Template for providing read only and editing interface of the same column in the Grid View.By Default, Grid View control displays Item Template which directly shows the Product Name and Unit Price columns but when user clicks Edit button Grid View automatically switches to Edit Item Template and display the control available inside Edit Item Template for user editing.
Search for rowupdating change:
In the Page_Load event, you simply load your data from the database and bind it with the Grid View control as shown below: For brevity I am not storing connection string in the web.config and also not using any Data Access Component.