Rowupdating not working

Here's what I'm starting with code-wise (MSSQL): So, in the gridview controll, during an update, the person is able to type in their Role Name.

I will need the 'old' role name in order to map it to a role Id, then I need the 'new' role Id in order to update the User Roles table.

After it has been clicked the postback places that row in edit mode. At this point in time the above Edit Item Template is displayed with two Image Buttons within it. My problem lies in that the click on the Update Image Button posts back, but neither the Row Command nor Row Updating events get triggered.protected void Grid View1_Row Updating(object sender, Grid View Update Event Args e) For more details then refer to this link below need to BIND your Grid View after Updating to reflect changes from the Database...protected void Grid View1_Row Updating(object sender, Grid View Update Event Args e) For more details then refer to this link below using an Sql Data Source that allows updating, as his code shows, it should automatically rebind after a successful update. Row Updating event handler, you would be binding before the update has occured. The weirdest thing is, I have two buttons in my grid - 'Enable' and 'Disable', where only one is displayed at a time based on the value of a bit field in my database and simply toggle this value when clicked.Check the value of the Grid View's Data Key Names property.This happened to me: upon inspecting the Data Key Names property, I found it set to a field which had formerly been a primary key in a table but which now was a non-key field.

Leave a Reply