如何使用C#获取列表视图所有行中特定列的值? [英] How to get the value of the particular column in all rows of the listview using C#?

查看:947
本文介绍了如何使用C#获取列表视图所有行中特定列的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含三列的列表视图,并且在列表视图中添加了4条记录.
我想获取每个记录的第二列值的值.如何实现它?

I have a listview with three columns and i have added 4 records in the listview.
I would like to get the value of the 2nd column value of each records.How to implement it?

推荐答案

您可以尝试以下代码

you can try this code

int i=0;
while (i < listView1.SelectedItems.Count)
{
               x = listView1.Items[i].SubItems[1].Text.ToString();
               i++;
}



尝试还原



Try and revert back


这篇关于如何使用C#获取列表视图所有行中特定列的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆