dynamic events on dynamic controls

D

dje

I'm creating my first custom control; it has a table with a variable
number of cells (user defined at design time). Each cell has a button.
Is it possible to attach events to these buttons? If so, how?
 
A

ashelley

I'm creating my first custom control; it has a table with a variable
number of cells (user defined at design time). Each cell has a button.
Is it possible to attach events to these buttons? If so, how?

You will have to probably recreate the whole table with all the cells
/ buttons / event handlers each time the page comes back. this is not
a definate answer tho.

-Adam
 
R

Robert Koritnik

Yes. You have to recreate the whole control again. You probably do that n
CreateChildControls overridden method. You have to do this in some way:
- recreate all controls
- restore from some persisting storage (Cache, Session etc). Somewhere where
you can store whole objects

When you recreate those you always have to connect to event handlers the
normal way.

Would you like to have a default event handler or would you like to define
the handler on the page, that uses this control. You'd have to do some more
coding if the second one is the case.
 

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

Similar Threads

Panels and dynamic controls...again 1
Events for dynamic controls 1
Help design HTA 0
Dynamic Controls 0
Dynamic controls 9
Dynamic Controls 1
[C#] Extend main interface on child level 0
Dynamic Controls 0

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top