Custom webcontrol with reference to another one

I

iontichy

Hi,
I've been working on a custom webcontrol with a property that
references another webcontrol from the same page.
In my special test case I have a Person_firstname1 control and a
PersonSource1 control. The Person_firstname1 have a property of the
type PersonSource. Now i want to assign the this property in the visual
studio designer. How could I persuade the designer, to show a dropdown
list of the controls in the page with the correct type (e.g.
PersonSource1, PersonSource2 etc.)

Thanks in advance,
Mirko
 
N

Nathaniel Greene

Hello,
You would want to use the
IDReferenceProperty attribute
Seee the below code.
I created 2 classes - MailLink and ToLink. for ToLink there is a property
called Buddy that can be any MailLink. By attachign this attribute and
specifying the type then it will automagically enumerate these for you.

MailLink gBuddy;
[Browsable(true), IDReferenceProperty(typeof(MailLink))]
public MailLink Buddy
{
get { return gBuddy; }
set { gBuddy = value; }
}
 

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,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top