开发者

listview Selected Item

开发者 https://www.devze.com 2022-12-30 05:20 出处:网络
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! ;)

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

0

精彩评论

暂无评论...
验证码 换一张
取 消