extending properties within a collection -
06-09-2005
, 10:27 PM
Hi
My validators derive from BaseValidator and
they EXTENDS certain properties to type Controls
by implementing IExtenderProvider.
Like in Tooltip component, If I drop my
validator components on to a form, relevent properties
get extended to the required controls.
However, what I want is to have just one component
inside which has other validator types. So I
did a FormValidator, component which has all the other
validators. FormValidator extends;
[TypeConverter(typeof(ValidatorCollectionConverter) )]
[Category("Validators")]
public ValidatorCollection GetValidators(Control control)
{
return validators;
}
Now, when I drop a FormValidator to a form
every relevent control in the form gets a
"Validators on formValidator1" extended propertry
which is expandable and inside I can see my other
Validators. Howerver, now I can't see the other validator's
extended properties.
In brief, when a FormValidator is dropped on to a form
I want the property grid to be something like;
[PropertyGird of TextBox]
.....
(+)Validators on formValidator1 (extended property from FormValidator)
(+)ValidatorType1
ErrorMessage on ValidatorType1
....
(+)ValidatorType2
ErrorMessage on ValidatorType2
....
I hope this explains the problem. Any way to do this?
rgds
KK |