Custom DataGrid Control - problem with adding BoundColumn

Discussion in 'ASP .Net Datagrid Control' started by Michael Tanner, Jan 29, 2004.

  1. 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!
     
    Michael Tanner, Jan 29, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andla Rand
    Replies:
    0
    Views:
    347
    Andla Rand
    Apr 6, 2004
  2. Yunus Emre ALPÖZEN [MCAD.NET]
    Replies:
    1
    Views:
    716
  3. mesut
    Replies:
    0
    Views:
    581
    mesut
    Jun 29, 2007
  4. Michael Tanner

    Custom DataGrid Control - problem with adding BoundColumn

    Michael Tanner, Jan 28, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    172
    Michael Tanner
    Jan 28, 2004
  5. Stephen Miller

    Adding a SubTotal to a named BoundColumn

    Stephen Miller, Feb 5, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    140
    Stephen Miller
    Feb 5, 2004
Loading...

Share This Page