i have function which return list as given below.
List<User> lstUsers = SearchUsers(searchText);
which gives a result like below
Username AddedDate
-------- --------- sa 02/02/2010 ba 02/02/2011 ta 02/02/2009
Its gives a reult that is not a problem.I want to create new list filter by date. For example just want a result between the date 01/01/2009 and 02/02/2010.Is there any method in asp to filter a list.
List<User> lstFilterUsers = \\Want Help Here(Filterd new List);
Thanks.
LINQ is great for this:
If you can’t use LINQ, use a delegate instead:
EDIT: If you’re dealing with search strings, and your
AddedDateproperty is of typeDateTimeyou will have to do some string parsing first, e.g.:Then bind the list to your grid: