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