Composite controls in a DataGrid

P

Phil S.

I'm having dreadful trouble putting a simple composite control into the
DataGrid cell, so I'm hoping someone might have stumbled across this problem
before and have some advice.

My composite control is a date picker which contains a couple of basic text,
drop down and image button controls. My control follows the composite design
guidelines carefully and behaves perfectly when used on a web page. It uses
ViewState and gets events from is child controls without problems.

When my composite control is added to the Controls collection in a DataGrid
cell it all goes wonky.

When called by the DataGrid OnItemDataBound I create the control with the
same ID each time and add it to the Controls in a cell. The control appears
correctly, but the following goes wrong:

* The ViewState keeps coming back null.
* The control events don't fire the first time, but do on the second and
following clicks.

I've been stuck on this problem for several hours and I'm getting quite
frustrated. Any advice or suggestions would be most welcome.

Thanks
Phil
 

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,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top