I have my onrowupdating method, and it works, except for this one value is not getting passed to the method. The problem lies in one of the rows that I converted to a templete field and added a dropdownlist to.protected void Page_Load(object sender, Event Args e) protected void search GV_Row Editing(object sender, Grid View Edit Event Args e) protected void search GV_Row Canceling Edit(object sender, Grid View Cancel Edit Event Args e) public void Fill Grid() protected void search GV_Row Updating(object sender, Grid View Update Event Args e) int media_id = Convert. I have a Gridview with Auto Generate Columns="False".I am using a Template Field to display my Edit, Update and Cancel 'buttons' in the first column of the Grid View within respective Item Template and Edit Item Template fields.Within the Item Template I have an Image Buttong with a Command Name of "Edit".This works as expected and I can put a breakpoint in the Row Command event handler to see the "Event" command name.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.
Storing datatable in View State is not a good practice as it increases the size of your page and reduces the performance, also View State can be deciphered on the client side, so the Data Table is not secure.This enables you to provide an event-handling method that performs a custom routine, such as canceling the update operation, whenever this event occurs.Raising an event invokes the event handler through a delegate. open visual studio – In above screen we can see, there are five column in User Mst Table in sql.The first column is ID which is identification of user, so it must be unique.I removed everything I did with View State and edited the original post again with what I currently got. I cannot sort the Grid View because I'm trying to sort with Your code doesn't have Data Source ID.