Code for rowupdating
I had a assignment I need to show only description and not ID. By using Datakeynames property you will get the selected row primary key.
Secondly if you want to include a custom field (some button or link) in the same column it’s not possible.When we edit a row in our Grid View and press the “Update” button, at some time it’s received in the Row Updating method.But as I noted in the comments in that method, some collections that should contain the columns (names, old values and new values) are always empty. And the Row Updated method is never even touched!!! NET Forums that I need to use a Data Source control.If we use proper command names for the buttons like “EDIT”, “DELETE”, “UPDATE”, “CANCEL” these will also trigger the appropriate Grid View Events.Ok let’s move on to Code behind what we have to do when user clicks Edit, Delete, Update and Cancel When we click on Edit the On Row Editing event will be fired.For example a Sql Data Source, which is automatically added to your Web Form if you drag-n-drop your way around Visual Studio 2005.
The problem is, I’d very much like to do so, if ASP. But I can’t set a Data Source property or anything on the Sql Data Source!!! I probably have to read the cells on the Grid View of the selected row, find the controls, get the values from those and insert those into my Data Set.
For a while now I’m trying to figure out why my method, triggered by the Grid View.
Row Updating event, doesn’t work as all samples say it should do.
You can see the C# code below will give the row number whatever you are editing by New Edit Index property.
So Grid View will put the appropriate row into the Edit Mode by assigning row number to its Edit Index property. You can follow any responses to this entry through the RSS 2.0 feed.
So am calling the method Bind Grid Data method which is overloaded .