开发者

listview checkbox checked row item

开发者 https://www.devze.com 2023-01-05 01:49 出处:网络
I want to reach checked rows item in ASP.Net Listview control. For examp开发者_开发知识库le: if 3 Lines of Listview checked, I want to reach checked items value in listview.

I want to reach checked rows item in ASP.Net Listview control.

For examp开发者_开发知识库le:

if 3 Lines of Listview checked, I want to reach checked items value in listview.

How can I do this?

Thanks.


You can use listview property 'CheckedItems'.

You can get list of items which are checked using listview.CheckedItems. For the value in that item, based on the subitem index you need to fetch it. For ex.

ListView.CheckedListViewItemCollection checkedItems = 
            ListView1.CheckedItems;

        foreach ( ListViewItem item in checkedItems )
        {
            value = item.SubItems[1].Text;
        }
0

精彩评论

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