Click here to Skip to main content
11,429,977 members (72,833 online)
Rate this: bad
good
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
Comments
SAKryukov at 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...
--SA

1 solution

Rate this: bad
good
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.

See http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton.aspx[^].

—SA
  Permalink  
v3
Comments
Espen Harlinn at 7-Jul-11 14:37pm
   
Good points, my 5
SAKryukov at 7-Jul-11 14:44pm
   
Thank you, Espen.
--SA

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



Advertise | Privacy | Mobile
Web04 | 2.8.150428.2 | Last Updated 7 Jul 2011
Copyright © CodeProject, 1999-2015
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