How to reference hidden columns

Discussion in 'ASP .Net Datagrid Control' started by David L, May 28, 2004.

  1. David L

    David L Guest

    I'm trying to reference a hidden key column in my datagrid control without
    success. I've set the columns up at design time through the property
    builder, and I've set my key column's visible property to false. In my
    updatecommand event I need to reference the key value for the update but I
    can't get anything but an empty string when I reference
    e.items.cells(1).text

    Thanks in advance
     
    David L, May 28, 2004
    #1
    1. Advertisements

  2. David L

    Rick Spiewak Guest

    If a column's visible property is set to false, it doesn't render, and won't
    participate in viewstate or postback. Get the key value from the dataset or
    datatable instead.

    "David L" <> wrote in message
    news:...
    > I'm trying to reference a hidden key column in my datagrid control without
    > success. I've set the columns up at design time through the property
    > builder, and I've set my key column's visible property to false. In my
    > updatecommand event I need to reference the key value for the update but I
    > can't get anything but an empty string when I reference
    > e.items.cells(1).text
    >
    > Thanks in advance
    >
    >
     
    Rick Spiewak, May 28, 2004
    #2
    1. Advertisements

  3. You can get the hidden column value even on client side if you hide the
    column with attribute display:none in a stylesheet.

    Eliyahu

    "Rick Spiewak" <> wrote in message
    news:...
    > If a column's visible property is set to false, it doesn't render, and

    won't
    > participate in viewstate or postback. Get the key value from the dataset

    or
    > datatable instead.
    >
    > "David L" <> wrote in message
    > news:...
    > > I'm trying to reference a hidden key column in my datagrid control

    without
    > > success. I've set the columns up at design time through the property
    > > builder, and I've set my key column's visible property to false. In my
    > > updatecommand event I need to reference the key value for the update but

    I
    > > can't get anything but an empty string when I reference
    > > e.items.cells(1).text
    > >
    > > Thanks in advance
    > >
    > >

    >
    >
     
    Eliyahu Goldin, May 30, 2004
    #3
    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. Mark Rae

    GridView controls and hidden columns

    Mark Rae, May 14, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    2,501
    Mark Rae
    May 14, 2006
  2. Steven Nagy

    GridView ObjectDataSource hidden columns

    Steven Nagy, Feb 7, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    714
    Steven Nagy
    Feb 8, 2007
  3. MP

    GridVIew columns (hidden)

    MP, Feb 15, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    540
    Eliyahu Goldin
    Feb 15, 2007
  4. Rick
    Replies:
    3
    Views:
    10,184
    Alexey Smirnov
    Apr 13, 2010
  5. Boban Dragojlovic

    hidden columns that contain a "key" field

    Boban Dragojlovic, Oct 10, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    188
    bspann
    Oct 13, 2003
  6. source

    Dynamically Generated Columns needs to hidden

    source, Dec 29, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    169
    Renee Kraft
    Jan 9, 2004
  7. Wallace Santos

    Hidden columns in execution time

    Wallace Santos, May 26, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    218
    Eliyahu Goldin
    May 27, 2004
  8. SolarCanine
    Replies:
    2
    Views:
    613
    SolarCanine
    Sep 20, 2005
Loading...