Net itemupdating

When the update button is pressed it takes to Grid View_Item Updating event as shown below code.

But when i set up a breakpoint and read changed Text Box value, it is still the old value( the value before Edit button is pressed).

Are you saying that there is NO WAY to *manually* tell the dataform to go back to View mode after updating?

Thanks but as I stated I don't do the update in that way using a data table, I have to use Sql Command objects instead.

In case this is not happening for your application this means that there are some issue in the logic you are using.

It will be best if you can send us your page markup as well as the related code behind so that we can revise this logic and advise you further.

I'm sure it's a simple thing but it just stays in "Edit" mode even after a successful update.

I have to click "Cancel" to get back to the View Template. This has to be me just missing something amazingly simple. Amy , I would suggest you to review the online demo below that demonstrates the required functionality: it a test and see if it works for you.

net itemupdating-1

Data Item Index 1 means it will give serial number to each row. The List View control has a built-in editing feature that automatically puts an item in edit mode if you add a button to the item template whose Command Name property is set to Edit. Add Edit Item Template to List View control as shown below: Similar to Edit button Add Command Name for Update button and Cancel button.

As well as add List View events onitemupdating="lv Employee_Item Updating" and onitemcanceling="lv Employee_Item Canceling" respectively.

When this property is set to the index of an item in the control, that item is displayed in edit mode.

Most notibly, the values dictionaries in the events for updating are not filled. Find Control("address"); whereas, and I think, your detailsview is named dv Record.

Among the solutions named often are looking up the Controls to take the values, and using Object Data Source. Please remember to click “Mark as Answer” on the post that helps you. so I suggested to use this: Text Box test = (Text Box) dv Record.

Leave a Reply