I'm fairly new to C# and SQL. I'm trying to build a search tool for a system that I am helping to build. What I am wanting to do is simply add 'select all' to a database bound drop down list so that when users choose select all from the list and clicks search it will search all of the items in the dropdown list
My pretty basic code so far is:
Now how do I get it recognise that when the user clicks on Select All that it should search all of the items in the dropdown list? Any help would be greatly appreciated :)
Thanks
Kristin
Sam HobbsPosted Nov 30, 2009, 12:05 PM
Kirtan PatelPosted Nov 30, 2009, 11:47 AM
you can handle it using Simple if Condition
just give you rough idea how to do it .
if ( DropDownlist1.SelectedItem.ToString() == "--Select All --")
{
//Code to Search Every Item Except Select All
}
else
{
///Code to Search Just Single Item
}
if still not resolve then .
Send me Your Code I will Modify your Code to get desired Output you want .
Send Me Your Project Files+Database (zip) to me in mail [email protected]
Kristin LacyPosted Nov 30, 2009, 10:21 AM
Thanks
Kirtan PatelPosted Nov 30, 2009, 10:12 AM
you can not Normally ad Select All in Data Bound Combo Box ..
you need to Add "Select all " in your database so that it shown in DropDown List
so just add Value ---Select All --- in your database .
Another way of doing it is By Fill the Combobox By DataReader Just add --Select All -- as First Item
then Add Item One By One .in Dropdown list
Friend, if You Still need Assistance then let me know .