Click here to Skip to main content
15,916,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

I have Listview items with checkboxes and image buttons. Please find the screen show from below url.

https://s24.postimg.org/mh7pdjb2t/image.png

I want two scenario...

1) After select one row, then click on fist image button - want to get one row listview details in code behind (Now it's happening). Please find the screen show from below url.

https://s29.postimg.org/iej2k9mzb/image.png

2) After select one or more checkboxes then click on the second image button - want to get whole checked items from the listview. Please find the screen show from below url.

https://s23.postimg.org/z18o84qsb/image.png

But after applying this code not getting all checkbox selected items.

HTML
<GridViewColumn>
                                            <GridViewColumn.CellTemplate>
                                                <DataTemplate>
                                                    <CheckBox Tag="{Binding UserId}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" />
                                                </DataTemplate>
                                            </GridViewColumn.CellTemplate>
                                        </GridViewColumn >


I know this is because of not using this code inside the checkbox shown below.

HTML
<CheckBox Tag="{Binding UserId}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" IsChecked="{Binding RelativeSource={RelativeSource AncestorType=ListViewItem},Path=IsSelected}" />


But I don't want this code because after implementing this code, then click on the listview's row automatically selecting checkbox too.

What I have tried:

After select all check-boxes, then want to get all listview items here,

C#
foreach (DocumentsUser item in listView1.SelectedItems)
                    {}


How can I handle this? Please help me...
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900