Adding runtime columns to designtime datagrid

Discussion in 'ASP .Net' started by Chip, Nov 10, 2003.

  1. Chip

    Chip Guest

    I've got a datagrid defined on the design page. At runtime, I'd like to add
    a bound column. I'm using
    Dim CallNum As New BoundColumn()
    CallNum.DataField = "call_num"
    CallNum.HeaderText = "Call #"
    CallNum.Visible = True
    grdList.Columns.Add(CallNum)


    But, the new column is not showing up at runtime. Is there another step to
    this?

    Chip
     
    Chip, Nov 10, 2003
    #1
    1. Advertisements

  2. Chip

    Chip Guest

    Just figured it out. The new column doesn't survive the postback, so it
    needs to be added just in time for use.


    "Chip" <> wrote in message
    news:...
    > I've got a datagrid defined on the design page. At runtime, I'd like to

    add
    > a bound column. I'm using
    > Dim CallNum As New BoundColumn()
    > CallNum.DataField = "call_num"
    > CallNum.HeaderText = "Call #"
    > CallNum.Visible = True
    > grdList.Columns.Add(CallNum)
    >
    >
    > But, the new column is not showing up at runtime. Is there another step to
    > this?
    >
    > Chip
    >
    >
     
    Chip, Nov 10, 2003
    #2
    1. Advertisements

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. =?Utf-8?B?RGF2ZXkgUA==?=

    Datagrid Template Columns At Runtime

    =?Utf-8?B?RGF2ZXkgUA==?=, Jun 10, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    536
    =?Utf-8?B?RGF2ZXkgUA==?=
    Jun 10, 2005
  2. Varangian
    Replies:
    7
    Views:
    767
    Varangian
    Apr 27, 2006
  3. Grupo ESI - Cotarelo
    Replies:
    0
    Views:
    488
    Grupo ESI - Cotarelo
    Sep 29, 2008
  4. General Chaud Caliente

    Segregating designtime from runtime

    General Chaud Caliente, Oct 17, 2003, in forum: ASP .Net Building Controls
    Replies:
    8
    Views:
    570
    Victor Garcia Aprea [MVP]
    Oct 24, 2003
  5. rob thomson
    Replies:
    0
    Views:
    439
    rob thomson
    Sep 4, 2003
  6. Naveed Alam

    Adding Columns at runtime in datagrid control

    Naveed Alam, Sep 5, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    212
    Naveed Alam
    Sep 5, 2003
  7. Edward J. Stembler

    Designtime error when accessing DataGrid Columns collection

    Edward J. Stembler, Oct 17, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    195
    Edward J. Stembler
    Oct 17, 2003
  8. ton
    Replies:
    2
    Views:
    325
    Alvin Bruney [MVP]
    Feb 11, 2004
Loading...