Jun 17, · This code works fine except when user edits a row pNumber is shown as number 1 or 2 instead of the string open or closed. I cannot set SelectedValue to open or . If you want to let users modify the data, you also usually add buttons to the ItemTemplate template that let the user select a record, switch to edit mode, or delete a record. To specify the custom template declaratively, add an ItemTemplate element inside the ListView control. You can then add the contents of the template to the ItemTemplate. To specify a template for the item selected for editing, place the EditItemTemplate> tags between the opening and closing tags of the DataList control. You can then list the contents of the template between the opening and closing EditItemTemplate> tags.
Edititemtemplate item template attributes
You can do the above steps in code by creating a class that implements the ITemplate interface and set an instance of it to the ItemTemplate property of the. Set the button's CommandName attribute to “edit” to cause the list to fire the EditCommand the rest of the ItemTemplate in here -->