Gridview is not updating

posted by | Leave a comment

In this method, I am specifying the Edit Index property of the Grid View to -1.As there is no row at -1 position so Grid View will be shown in normal mode.You can notice that I have kept Required Field Validator too inside the Edit Item Template as I want the textbox to be validated for empty data.In the same way you can put any kind of Validation controls inside Edit Item Template to validate the form element while user will click Update link.

In this method, we have to get changed values of Text Box and Drop Down list and also we need the primary key value for the record that is being edited.Till now our Grid View is ready to be populated, now let’s write a method to populate the Grid View.To populate the Grid View, I am calling Bind Data() method from Page_Load event after checking Is Post Back property of the page, so the Grid View will only be populated when there is no postback on the page (when the page loads for the first time).In this article, I am going to explain how to manipulate data using Grid View control.This article scope is limited to Updating and Deleting records using Grid View and I am not using any readymade Data controls for that but manually writing all event methods.

Leave a Reply

dating single mom teenage daughter