Hi Sean,
In order to achieve the scenario you require for replicating the ListBox demo with ListView, I may suggest you follow the steps bellow:
- Use the "SelectedIndexChanged" server-side event to get the selected DataItem index;
- After retrieving the selected DataItem index, you can extract the data from the ListView and populate the second control that will display the "expanded view" (a second ListView for example):
- Use the second control to edit the data (if second ListView is used you may easily add the selected DataItem and add it to the second ListView, set its Edit property to "true" and edit the item);
- On event of your choice from the second control you may update the data of the ListView;
If you however decide to implement the previous scenario with opening edit mode on selection I may suggest you the following solution:
- Set ItemTemplate and EditItemTemplate of the ListView;
- On SelectedIndexChange event you can set the Selected property of the item to "false" and then set the "Edit" property to "true":
- For updating the data you may refer to the demo above.
Additionally, please review the following online demos so you can get a better idea of how to use ItemTemplate, EditItemTemplate, LayoutTemplate and SelectedItemTemplate.:
If we can be of any further assistance, please feel free to contact us again.
Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the
blog feed now.