.NETGURU
ControlToValidate - CheckBoxList
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolscs' list.


Robm
Hello

I have created a CheckBoxList validator which ensure that the max and min #=
of items have been checked.
Everything works properly, but I would like to be able to select a CheckBox=
List within the ControlToValidate section in the VS.Net properties window. =
Currently, the list that is displayed will only show TextBox's, ListBoxes, =
..., but not CheckBoxList.

I assume this is inherrited from the System.Web.UI.WebControls.BaseValidato=
r class, so does anyone know how to override this feature so that it shows =
CheckBoxLists?

Thanks,

Robert Merriott
.Net Developer

Reply to this message...
 
    
Andy Smith
you'll have to change the UITypeEditor for that property.
I believe it's the Editor attribute applied to the propety.

you could probably inherit from the one the current UITypeEditor to do =
it.

__
Andy Smith
Keyboard Jockey #3a7-2.78.1

[Original message clipped]

Reply to this message...
 
    
Robm
Hey Andy

Thanks for getting back to me.=20
Would you be able to elaborate more on the type that I should be using?

Within my class, I now have the following code...

[Editor(typeof(System.Web.UI.WebControls.CheckBoxList), typeof(System.Drawi=
ng.Design.UITypeEditor))]=20
public string ControlToValidate{
    get{return this.ControlToValidate;}
    set{base.ControlToValidate =3D value;}
}

* Note, I am extending the BaseValidator class

Which throws an exception within VS.Net (Didn't think the CheckBoxList was =
correct, but thought I would try)
Do you know the proper values to place into the Editor section or where I c=
ould find/figure these out?

Thanks,

Robert Merriott
.Net Developer

>>> Click here to reveal e-mail address 08/09/02 10:50AM >>>
you'll have to change the UITypeEditor for that property.
I believe it's the Editor attribute applied to the propety.

you could probably inherit from the one the current UITypeEditor to do it.

__
Andy Smith
Keyboard Jockey #3a7-2.78.1

[Original message clipped]

| [aspngcontrolscs] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngcontrolscs.asp =3D JOIN/QUIT
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
John John
hi,
the solution is much simpler. you just have to add the
ValidationPropertyAttribute attribute to your class:

    [
    DefaultProperty("Text"),
    ValidationPropertyAttribute("Text")
    ]
    public class EnhLabelEdit : WebControl, IPostBackDataHandler
    {

    }
and yep, I agree, it was not easy to find...
John.

[Original message clipped]

Reply to this message...
 
 
System.Drawing.Design.UITypeEditor
System.Web.UI.IPostBackDataHandler
System.Web.UI.MobileControls.BaseValidator
System.Web.UI.MobileControls.TextBox
System.Web.UI.ValidationPropertyAttribute
System.Web.UI.WebControls.BaseValidator
System.Web.UI.WebControls.CheckBox
System.Web.UI.WebControls.CheckBoxList
System.Web.UI.WebControls.TextBox
System.Web.UI.WebControls.WebControl
System.Windows.Forms.CheckBox
System.Windows.Forms.TextBox




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification