This article is a mirror article of machine translation, please click here to jump to the original article.

View: 20663|Reply: 0

[Source] C# gets the value of a selected row in the listview

[Copy link]
Posted on 5/10/2016 3:55:25 PM | | |
First of all, you have to determine whether listView1.SelectedItems.Count>0 or listview1. SelectedIndices.Count>0, otherwise the first click will be unsuccessful.
Second, it seems that itemSelectionChanged or SelectedIndexChanged events can be triggered.


Select the value of the first column of the clicked row, the index value must be 0, and no matter how many columns of this row you click, the selected is the value of the first column of this row, if you want to get the value of this row except the first column, use subitems to get it, [] is the index, starting from 1.

It's not easy for rookies to write code, it's a special girl.




Previous:Containing files 'test.asp' cannot indicate the parent directory with '..'.
Next:https website prompt Problem with the SSL CA cert (path? access rights?)
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com