list of other controls in properties during design

M

marcin.kozlowski

Hi,
Basicaly what I'm doing, is making a TabPage control which is
"attached" to a MultiView control in order to have tab pages on my
webpage. That control has a property "MultiViewToControl" which is the
ID of the MultiView it should work with. Now I want this property to
behave like e.g. validator's "ControlToValidate", i.e. to have a
drop-down list of all controls on the webpage. I've read tons of topics
about this, but just can't get it to work in ASP.Net. In windows forms
(which I'm more familiar with than ASP.NET), using my own TypeConverter
and the TypeConverterAttribute works perfectly:

public class TestTypeConverter : TypeConverter
{
public override bool
GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
public override bool
GetStandardValuesExclusive(ITypeDescriptorContext context)
{
return true;
}
public override StandardValuesCollection
GetStandardValues(ITypeDescriptorContext context)
{
ArrayList temp = new ArrayList();
if (context == null)
return null;
if (context.Container == null)
return null;
foreach (Control c in context.Container.Components)
{
temp.Add(c.Name);
}
return new StandardValuesCollection(temp);
}
}

but when I try to do that in ASP, the context sent to GetStandardValues
is always null (could be seen by replacing the first "return null;"
with something more meaningful). Could anyone help me (whole code of a
simple class would be appreciated, as I've read some examples already
and never got them to work - maybe I'm doing sth stupid).

Oh and please forgive my English, I know it's far from perfect.

Regards
Marcin
 

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

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top