Combining Two Controls, best way?

A

Andrew Backer

I have a working date picker, and I want to combine it at the control
level with a textbox and validator, so we can use
<my:datepickertextboxthingy/>

What is the best way to go about this? I am most concerned with access
to the textbox's properties, since this will function mostly as a
textbox with a mostly-inert object attached to it.

Right now I have subclassed TextBox, and am attempting to somehow
attach the other control to it so they both get rendered. In the end I
think I would like to be able to wrap them in more html (tables, span,
div, etc), so I think I will need a little more control. In the end I
need to be here :

<my:textbox CssClass="Fun" Columns="10" ..more textbox props.../>

Where should I instantiate the addtional controls? How should I handle
prerender (the date picker needs it)? What should I do in Render() to
make this happen...

I guess I am really trying to avoid writing properties that wrap *all*
of the textbox properties. Any good way to do this?

TIA,
- Andrew Backer
 
A

Andrew Backer

So I have to go the composite way, eh? Oh well...

Are we sure that there is no way to inherit TextBox, thereby gaining
all it's fancy properties and methods, and *then* tacking on the
datepicker/checkbox/etc that I need?

Im going to go the composite way for now, but the other way would be
sooooooo nifty :)

Thanks for the article,
- Andrew Backer
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top