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);
}
}
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);
}
}