Now click on Edit button you will see the following output.
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. The link button in the Item Template is labeled "Edit" but uses Command Name="Select". Instead, I just use the Select command and the Selected Index Changing event to populate the control-set that I am currently using for inserts.When this property is set to the index of an item in the control, that item is displayed in edit mode.
In edit mode, the item is rendered by using the Edit Item Template template instead of the Item Template template.
I found how to get the key value so I know which record in the database I have to update. The first way would be to use a datasource that supports an update command and using two way binding to up date the values.
The problem is that I can't seem to access the values of the controls on the editing row. Item Updating Dim Drop Down Listddl As Drop Down List = List View. The following snipped uses two way binding to populate the name and student fields and it will also update them for you.
Protected Sub List View_Item Updating(By Val sender As Object, By Val e As System. You can use this to fetch the control values you want by handling the list views Item Command Event. I still have a problem, since using the Update Command in the aspx it expects an Item Updating event, which I now catch in Item Command. when I use another commandname I seem to have trouble with the viewstate when I reload my list ... I think I need to see some code before I can help, the command name should not cause Item Command to throw any errors.
Also are you still handling the Item Updating event? I think you can do everything you were doing in the Item Updating event in the Item Command Event.
Edit Index = -1; Bind List View(); event does not fire at all.