HighTechTalks DotNet Forums  

list of other controls in properties during design

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss list of other controls in properties during design in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
marcin.kozlowski@internetium.pl
 
Posts: n/a

Default list of other controls in properties during design - 08-22-2006 , 06:23 AM






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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.