Download source code for Binding, Adding, Editing, Updating, Deleting, Paging and Sorting records in List View Control The asp: List View control supports data editing, insertion, deleting, paging and sorting like another powerful control Grid View.
But - unlike the Grid View, it provides us with complete control over the html markup generated like Data List or Repeater control using templates and styles.
Following is the code of the List View for this article, based on this I am going to explain most freqently asked questions about List View Control.
If you are learning asp: List View control while reading this article, you may copy-paste code described here.
This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. Item(0) = gets me the GUID in the Data Key Names - but I don't know how to get a reference to the row I have tried all sorts of ways to get a reference to the selected row--but e.commandargument is not working.....
NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. --------------------------------------- Imar Spaanjaars
In this method, I have the item to be edited using List View. Item Index] and got the key value (In Code - 1, I have specified Data Key Name=Auto ID). Find Control andr est code is as usual, simply opening the connection and executing the update statement.Clicking Edit link in the default mode for respective record bring that record into Edit mode so that user can modify the record.Once Edit link will be clicked then In this method, I have specified the Edit Index peroperty of the List View as the New Edit Index (the clicked reocrd) and rebind the List View so that I will have current record data into the Edit mode.Once i am done with executing the query, I have Rebound (Code - 2) the List View control.To Edit records in List View control, we need to add Edit Item Template (Code - 1).