Non-displayed values in DataGrid that stay accessible in EditCommand event?

Discussion in 'ASP .Net Datagrid Control' started by Mike, Dec 6, 2003.

  1. Mike

    Mike Guest

    I've got an app with a DataTable that gets passed around and modified
    by datagrids on 3 different asp.net pages. Not all columns need to be
    displayed, but I need them all in the datagrid so I can call the
    LoadDataRow method to update the DataTable "in place".

    I've been using boundcolumns for the invisible fields, which worked
    fine, but now I've run into an issue with them. On the second of the
    3 pages, the user can modify certain values and if a row is modified
    in the datagrid I immediately update the DataTable, so I've got some
    code in the grid Grid EditCommand event that handles all this.

    For some reason the boundcolumns that are set to visible = False all
    return empty strings in the EditCommand event, even though they
    contain legitimate values. At first I tried getting the values out
    using e.item.cells(x).text - that didn't work. I've noticed in
    certain other situations that I have to dimension a textbox, assign
    the textbox to the cell in question and then read the textbox.text
    value into a string var, so I tried that and it didn't work either.

    Just to make sure the grid columns were all being populated I set
    visible to true temporarily. Sure enough all columns had data *and* I
    was able to fetch the values from the boundcolumns using both of the
    methods described above.

    So I guess my question, put concisely, is what is the best way to
    store non-displayed values in a datagrid in a fashion that will allow
    them to be easily accessed in the grid's EditCommand event?

    TIA,
    Mike
     
    Mike, Dec 6, 2003
    #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. Mike
    Replies:
    0
    Views:
    360
  2. Craig Deelsnyder

    Re: datagrid EditCommand event

    Craig Deelsnyder, Jul 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    358
    Craig Deelsnyder
    Jul 9, 2004
  3. bill
    Replies:
    2
    Views:
    3,125
    Usmanr
    Jun 16, 2008
  4. Robert Pettersson

    EditCommand event in Datagrid question

    Robert Pettersson, Jun 9, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    165
    Robert Pettersson
    Jun 9, 2004
  5. Alex

    EditCommand event

    Alex, Aug 6, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    190
Loading...

Share This Page