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)
- {
- int DocId = Convert.ToInt32(item.Id);
- }
- }