Custom DataGrid Control - problem with adding BoundColumn

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!
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top