Link to home
Start Free TrialLog in
Avatar of TrialUser
TrialUserFlag for Afghanistan

asked on

filtering results in listview by column name

HOw can I filter results in a listview control. I have 5 boolean fields that I would like to show in a drop down and filter on those columns. please help thanks
Avatar of code_me
code_me

you can use the
Selected Index change
property of
your Dropdown

and In the select Query
pass the id or the filter
option you want

and with selected index changed
event of Dropdown
Fill the Listview

try this..will work
Avatar of Nasir Razzaq
More description please. What 5 fields? What columns are shown in Listview? How are you accessing data? Using AccessDataSource/SqlDataSource?
Avatar of TrialUser

ASKER

I call a SQL Server stored procedure to return data. I bind the Dataset.tables(0) to the listview on Page Load.

I have some boolean fields like : IsRecyclable, IsGreen, IsFreeShippable and so on.
I would like to have a drop down for these boolean fields like :
Show All, Only Green, Only ISFreeShippable = true

So is there anything inbuilt in asp:listview that I could take advantage of? Or should I have a drop down and on Selected Indiex change fetch data again from SQL and bind it? Please help thanks

ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial