Inheriting PanelHolder Problem Plz Help!!

L

Liam Ponder

In short

The datagrid works in a panelholder,
The datagrid does not work when doing a postback in a
control inherited from panelholder.

I have a custom control that inherits the placeholder
server control. Inside my custom controls, everything
works fine except the datagrid, I have to manually do a
databind on each page postback in order to receive the
events.

If I put the datagrid inside the panelholder control, it
works fine.

I am only overriding AddParsedSubObject and
CreateChildControls. Do I need to add something to make
the datagrid retain its datasource across a postback in
an inherited panelholder?? I am assumming it be in one
of those methods. Here is the code for those methods

protected override void AddParsedSubObject(Object obj)
{
if (obj is Control)
{
items.Add((Control)obj);
}
}

protected override void CreateChildControls()
{
foreach(Control c in items)
{
// Create a table to put in the controls
// ..

// htmlCell is a TableCell
htmlCell.Controls.Add(c);
}
}
 

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,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top