Advanced control problems

J

Jason

Hi,

I am using .net 1.0 sp2. I also have on another machine .net 1.1 though
until such time as the template control problem is fixed in asp.net 1.1 i
don't use it except to try new code out on.

So i wrote myself a control which has desing time support built in - namely
that i can add other controls to the page in deisgn time - and a property in
my control can display a list of names of controls on an aspx page if they
implement a specific interface. this is achieved you guessed it by using a
UITypeEditor and the associated attribute Editor over the respective
property.

All is well. The problem comes from my TypeConverter implementation to
convert the string names returned back into my interface. Under version 1.1
decorating my interface class (the one which the controls implement) with a
typeconverterattribute specifying my custom type converter works perfectly
in VS.Net 2003. Using VS.Net 2002 however the same code seems to not be
calling out to my typeconverter. Actually i tell a lie. I debugged the
design time control and i noticed after it had returned from EditValue (with
a string of the control name) it did not use my typeconverter until after it
had failed???????? So it goes like this.

I drop down the listbox in the properties window, it is populated by
editvalue with only those controls on the page that implement my interface,
i select one from the listbox and then

Properties Window popus up saying
"Invalid property value."
Click Details button
"Object type cannot be converted to target type."


then it actually breaks into my TypeConverter code and calls CanConvert,
wherein it returns true because the type passed in is a string (the same
type i returned from editvalue). Even though it returned true a call to
ConvertFrom never actually runs thereafter.

Anyone know what i am doing wrong? I know i am doing something wrong surely
because so many other controls, i.e the validators, all use strings to
return the ControlToValidate and they work fine.

Thanks in advance

J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top