开发者

How to get column value in selectedItems wpf?

开发者 https://www.devze.com 2022-12-24 01:13 出处:网络
I have many re开发者_Go百科cords from a database and i display it in a ListView. I need to delete it if I select it (multi-selection).

I have many re开发者_Go百科cords from a database and i display it in a ListView. I need to delete it if I select it (multi-selection).

But i need the Id (a column) to delete it and i can't get it. Please help^^

exemple:

column: id name note ... 1 name1 note1 2 ... 3 ...

if i select 1 and 3 I need to get the value (1 and 3). Thanks in advance!


loop through all the seleted rows and try this.

Subitems[columnnumber] will be the column numbr of the id field

lv.Items[i].SubItems[1].Text

0

精彩评论

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