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
533
2.4k
598k
error - Unable to cast object of type, wpf Listview
Jan 1 2017 12:49 PM
Hello everyone,
After bind listview with linq query, occuring error.
how can I solve this error ? Unable to cast object of type 'Grouping[System.String,<>
public
UC_ArcMgmt()
{
InitializeComponent();
DMSBusinessLayer service =
new
DMSBusinessLayer();
listView1.ItemsSource = service.GetArchivedList().SelectMany((x) =>
new
[] {
new
{ Id = x.Id, ArchievedName = x.ArchievedName, UpdatedDate = x.UpdatedDate, FileSize = FormatBytes(x.fsize), docCount = x.docCount } }).Distinct()
GroupBy((x) => x.ArchievedName);
}
private
void
btn_Click(
object
sender, MouseButtonEventArgs e)
{
foreach
(Tble_Documents item
in
listView1.SelectedItems)
/*here showing error*/
{
int
DocId = Convert.ToInt32(item.Id);
}
}
Reply
Answers (
5
)
WPF - How to get all checked selected items from Listview?
Datagrid checkbox not workign in single click