I am using C#. I need to know how can I access data which is on listview. tha开发者_如何转开发nk u.
Know that Google is your best friend! ;)
Here are the ListView Members. You want to use the SelectedItems property.
I'm assuming Windows Forms here.
Otherwise in WPF, you have both:
SelectedItem, inherited from the Selector class.
SelectedItems, inherited from the ListBox control.
Use the SelectedItems
property. This is a collection with all currently selected items. It may empty if no item is selected.
P.S: See the MSDN-Library
var item = YuorListViewName.SelectedItem;
Use the Items property as shown here
精彩评论