Click here to Skip to main content
13,146,402 members (48,681 online)
Rate this:
Please Sign up or sign in to vote.
Hi All,

I have a website, where in I can select the customer from a drop down list.

I would like to hide some of the customers name from being displayed in the drop down list as these customers have terminated services with us.

I wish to just hide the item to be displayed at run-time and not remove it.

Any idea ?? As i know how to remove but not sure to hide.

Appreciate for your feedback...

Posted 10-Sep-12 14:37pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you have a Flag in your Database table where customer information is stored , then you can filter the record which are active before binding it to Dropdown , else you can hide it using Linq
//a.Flag or (Your Filter criteria to identify the cusotmer is active or inactive

var customerList= GetCustomertList();  
customerList= customerList.Where(a => a.Flag != "Not Active or your interger value").ToList(); 

then bind the customerList to dropdown.
Nueman 11-Sep-12 0:20am
Nicely done. Thanks.
Kuthuparakkal 11-Sep-12 2:28am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2


I agree with above solution,that you just only retrieve 'A' flag Customer before binding(if you added flag for customers),


select customer from cust_tbl where rec_status='A';

Otherwise you just remove it manually at runtime,i.e.


if there are multiple then just add it into LIST and remove listItem from dropdown same as above remove statement.

hope this will help you...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 11 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100