How do I change the parent of a gridview bound to a SqlDataSouce?

B

Brian

Hey There,

I've created a custom control in ASP.Net based on a Panel.
I've only overridden one method.
CreateChildControls
In CreateChildControls I do the following:
1. Create an ASP:Table, add a row, add a cell.
2. Cycle through all of the controls of the custom control, remove them and
add them to this table cell.
3. Add the ASP:Table to the controls of this custom control.

Databinding remains happy if I have TextBoxs or even DropDowns w/ a
DataSource.

But when I add a GridView bad things begin to happen.

The GridView appears to require that I do an extra step:
EnsureChildControls
Data gets bound to the gridview if I do this.
But ... I can't seem to update the value's of any of the cells.

Clearly there are forces at work that I'm not aware of.
Can someone point me in the right direction?

Thanks,
Brian
 

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,744
Messages
2,569,479
Members
44,900
Latest member
Nell636132

Latest Threads

Top