开发者

WPF LISTVIEW Count The Rows

How can we get N开发者_JAVA技巧umber of rows Present in Listview?


Couldn't you just use ListView.Items.Count?


Well, you see. When you bind a list view to some sort of collection (preferably some sort of observable collection) with some sort of type. You can add/remove.

But you also have the functionality to say observablecollection.count.

Now if you are adding the items inside the XAML. a quick and easy way to access it is.

x:Name="name of the list" then in the code behind say (name of the list).count.

That should give you access within the code behind, or if you don't want to do it in the code behind. You will need some sort of window dictionary.

and you can access the (name of the list) through your dictionary.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜