M
Michael Tanner
have created a custom control that derives from a DataGrid:
public class SelectableDataGridControl : System.Web.UI.WebControls.DataGrid
I have overloaded the DataBind method and adding a custom DataGridColumn:
public override void DataBind()
{
base.Columns.AddAt(0, sdg);
base.DataBind ();
}
Adding my custom datagrid to a webform works perfectly as long as I leave
the AutoGenerateColumns set to true. I need to set this property to false
and add a few BoundColumns. When I add BoundColumns to the custom datagrid
via the Columns property in the designer, the columns are added to the
datagrid in the Design View; however, the columns are not added to the html,
thus they do not appear when viewed in the browser. The only column
displayed is the special column that I add in the overloaded DataBind
method.
How can I get the designer to generate the BoundColumn html at design time?
Any ideas are greatly appreciated!
public class SelectableDataGridControl : System.Web.UI.WebControls.DataGrid
I have overloaded the DataBind method and adding a custom DataGridColumn:
public override void DataBind()
{
base.Columns.AddAt(0, sdg);
base.DataBind ();
}
Adding my custom datagrid to a webform works perfectly as long as I leave
the AutoGenerateColumns set to true. I need to set this property to false
and add a few BoundColumns. When I add BoundColumns to the custom datagrid
via the Columns property in the designer, the columns are added to the
datagrid in the Design View; however, the columns are not added to the html,
thus they do not appear when viewed in the browser. The only column
displayed is the special column that I add in the overloaded DataBind
method.
How can I get the designer to generate the BoundColumn html at design time?
Any ideas are greatly appreciated!