Click here to Skip to main content
15,877,376 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have listview,which i fill using datatable

then i use checkbox onselected event , and filter some values datatable and fill again in listview ...

I have 2 different filter options , but when i use both , only filter is applied.

How can i make for exp.

filter 1 and fill listview,,and when filter 2 applied, get values of listview and from that filter with filter2 values

or u suggest what to do

Because, when checkbox event called, i filter table and then add table to listview

How to use different filter in same listview

1 solution


You can use Dataview object,it is a databindable, customized view of a DataTable for sorting, filtering, searching, editing, and navigation. The DataView does not store data, but instead represents a connected view of its corresponding DataTable. just follow of these links for know how to use DataView after that read you data from database and fill into DataView then user DataView filter facilities ;-)

DataView Class
DataView in C#
How to filter data in dataview
DataView RowFilter Syntax [C#]
DataViews and Data Binding—Searching a DataView

Best Regards.
Share this answer
maulikshah1990 6-Jan-14 2:55am    
but i have listview and from there i want to filter
Aydin Homay 6-Jan-14 3:02am    
What is your ListView repository ? DataTable ?
maulikshah1990 6-Jan-14 4:02am    
I did not understand ur question
I have listview which is filled from datatable..and i want to filter in listview and then when i filter other in same listview.
Aydin Homay 6-Jan-14 5:59am    
Fill DatView object from database and after than bind your list view to DataView. Make your filters on DataView

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