在列表视图中计数组项目 [英] counting group items in listview
本文介绍了在列表视图中计数组项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以帮我吗?
如何编写代码以计算列表视图中特定组下的项目.
例如,如果我有以下群组.
Hi,
Can anyone Help me plz?
how to write a code for counting items which are under certain group in listview.
for example if i have a following group.
Group1
item1
item2
item3
我必须写什么(代码),以使Group1中有3个项目.
我使用了以下代码,但它返回了列表视图中的所有项目.我需要知道特定组中的项目
what i have to write(code), in order to get that there are 3 items in Group1.
i have used the following code but it returns all the items in the listview. i need to know the items in the specfic group
public void countitem()
{
int x = listview.Items.Count;
textBox1.Text = x.ToString();
}
推荐答案
使用ListView.Groups[x].Items.Count
这篇关于在列表视图中计数组项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文