Control

S

shapper

Hello,

I created a custom control, Parent, with the following property:

Property Rows As Generic.List(Of Row)

Row is another custom control that creates some code.

The problem is that I want to create different types of rows:
InputRow, CheckRow, ...

All rows render the same way, i.e., a div with content inside it. The
content in the div is different for each row.

Basically I would like to do something like:

Dim MyParent As Parent

MyParent.Rows.Add(MyNormalRow)

MyParent.Rows.Add(MyInputRow)

MyParent.Rows.Add(MyCheckRow)

....

What should be the best way to do this?

Thanks,

Miguel
 
P

Peter Bucher [MVP]

Hi Miguel
Basically I would like to do something like:

Dim MyParent As Parent

MyParent.Rows.Add(MyNormalRow)

MyParent.Rows.Add(MyInputRow)

MyParent.Rows.Add(MyCheckRow)

...

What should be the best way to do this?
Normally you have a BaseClass Named Row, assign that type to your
CustomControl Property.
All your other Row Controls should inherit from your BaseClass Row.

Thats it.
 

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,787
Messages
2,569,631
Members
45,338
Latest member
41Pearline46

Latest Threads

Top