Click here to Skip to main content
12,815,986 members (39,878 online)
Rate this:
Please Sign up or sign in to vote.
I have a drop down list that has several options in it but I need to have a custom validator which does not allow the user to select 4 of the potential options in the drop down list. Any help would be greatly appreciated.
Posted 7-Jul-11 8:51am
SAKryukov 7-Jul-11 14:04pm
What would be the purpose of items which are visible in the list but not selectable? No wonder this option does not present in the original list view controls...

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

First of all, even if you implement such behavior, it cannot be called "validator". A "validator" is something which validates data after it is entered, but you want to filter out the input (selection) itself.

I fear to say such behavior is too far from expected UI behavior and would be very confusing. Implementation of it would be problematic, too.

There is a well-known equivalent UI presentation with the same logic: a set of radio buttons. If you control Enabled property of each radio button, you can enable or disable some of them depending on other data, effectively filtering the input the way you want.


Espen Harlinn 7-Jul-11 14:37pm
Good points, my 5
SAKryukov 7-Jul-11 14:44pm
Thank you, Espen.

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 | Mobile
Web02 | 2.8.170308.1 | Last Updated 7 Jul 2011
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