TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
536
2.4k
596.4k
WPF - How to get all checked selected items from Listview?
Dec 29 2016 2:51 AM
Hello everyone,
I have Listview items with checkboxes and image buttons. Please find the screen show from below url.
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.
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.
But after applying this code not getting all checkbox selected items.
<
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.
<
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.
foreach
(DocumentsUser item
in
listView1.SelectedItems)
/*After select all check-boxes, then want to get all listview items here.*/
{
}
Reply
Answers (
3
)
Blur behind window in wpf
error - Unable to cast object of type, wpf Listview