Hide UNBOUND datagrid cols?

Discussion in 'ASP .Net Datagrid Control' started by Eddie B., Oct 21, 2003.

  1. Eddie B.

    Eddie B. Guest

    Is there a way to hide an unbound datagrid column? The webform throws an
    error when I try to hide any of the columns that I do not have bound at
    design time.
     
    Eddie B., Oct 21, 2003
    #1
    1. Advertising

  2. Eddie B.

    Alvin Bruney Guest

    The easy way to do it is to set the cell.visible property to false in the
    itemcreated or itemdatabound event handlers. These events fire off when the
    grid creates a row or binds data to the row. The handle is exposed thru the
    e argument and references the current row. You are having this exception
    because unbound or dynamic rows aren't added to the column collection and
    are there for inaccessible from this collection.

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits/default.htm

    "Eddie B." <> wrote in message
    news:Ogc2RG$...
    > Is there a way to hide an unbound datagrid column? The webform throws an
    > error when I try to hide any of the columns that I do not have bound at
    > design time.
    >
    >
     
    Alvin Bruney, Oct 21, 2003
    #2
    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. PontiMax
    Replies:
    0
    Views:
    409
    PontiMax
    Jan 12, 2005
  2. Aaron Fude
    Replies:
    5
    Views:
    1,248
    Aaron Fude
    May 21, 2004
  3. phl
    Replies:
    2
    Views:
    1,951
  4. Eddie B.

    Hide data grid cols?

    Eddie B., Oct 17, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    136
    S. Spurlock
    Oct 17, 2003
  5. PontiMax

    Datagrid: Selecting multiple rows/cols

    PontiMax, Jan 12, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    169
    Michelle Hlaing
    Feb 21, 2005
Loading...

Share This Page