Aspxgridview rowupdating error
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. 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.
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".
The result should change your source line to look something like the following (in bold): All the tutorials mention that the Data Key Names entry is automatically added for you. Till now every thing is fine as I can edit only the column in the Edit Item Template but when I click the update button or link then my grid does not give me the edited new value but the old value is supplied in the paramter.
If you select the Grid View in the designer, and select that entry in the Properties box, you can select the correct values. So I changed the Bound Field to Template Field and for only the column that needs to be edited I used TEXTBOX for the Edit Item Template.
End Callback event to check if custom property exists and raise alert. Thank you so much for directing me in the right direction. Both the master and detail gridviews have link buttons for edit and add new activities. If I used the same code in the button click event of a button on the page, then it works fine. After either inserting new row or updating an existing row, I have to show a message box saying "Your update has been saved successfully". I event tried to set the text value of a asp: Literal control. didn't I create a database and totally duplicate YOUR grid so there could be a few other things wrong. I have everything that is talked about even the Data Key Name but still nothing gets updated. Hi All, I've had the exact same problem and came across a post on this site mentioning that if you have NULL fields in your data and checked the "Use Optimistic Concurrency" option when configuring your Sql Datasource, then the update won't work. Unfortunately, turning off Use Optimistic Concurrency kind of defeats the safeguard it provides and allows one user to clobber another user's data. I do not know what I have missed or where I have gone wrong. However, I discovered that if you change the Sql Data Source1 control to add or delete columns, a dialog pops asking if you want to "Refresh the Fields and Keys ..." This is where the problem occurs since it clears the Data Key Names entry (the pop-up tells you that, but who read the fine print? Also, you may not want a Drop Down List in the Item Template, but may want to leave it alone as a label and Eval it to the field to which the licensee_id field points. Of course Scott Mitchell has a bunch of online tutorials, although I somehow missed this I am having the same problem but can not get it to work. I was having the exact error until a few moments ago, but I finally got it[:)]. I am using My Sql as the back end.) and here it shows the new or the edited value.