Click here to Skip to main content
15,903,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Learning to cook — ObjectListView 2.9.1 documentation[^]

iam using this control and want to get all the models which are visible

What I have tried:

var model = this.BackUpStoragetreeListView.Objects.Cast<storagebackupobjectlist>().Where(x => x.Name.ToLower() == objAccount.AccountName.ToLower()).FirstOrDefault();

but it is returning only one selected model
Posted
Updated 23-Aug-16 20:01pm

1 solution


but it is returning only one selected model


That's because of: FirstOrDefault() at the end of line.
Replace it with: ToList() and everything should be OK.

For further details, please see:
Enumerable.FirstOrDefault(TSource) Method (IEnumerable(TSource)) (System.Linq)[^]
Enumerable.ToList(TSource) Method (IEnumerable(TSource)) (System.Linq)[^]
 
Share this answer
 

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