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
|
|
| |
| |
| 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]
|
|
| |
|
| |
| 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
|
|
| |
|
| |
| 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]
|
|
| |
|
|
|
|
|