Getting the column from a table cell

Discussion in 'ASP .Net Datagrid Control' started by zahidayar@gmail.com, Oct 3, 2005.

  1. Guest

    Hello everyone,

    Is it possible (and if so, how) to obtain a reference to the column
    given a table cell for a datagrid?

    Zahid
     
    , Oct 3, 2005
    #1
    1. Advertisements

  2. Elton Wang Guest

    What do you mean column, column of datagrid? And how do get the tablecell of
    the datagrid?


    <> wrote in message
    news:...
    > Hello everyone,
    >
    > Is it possible (and if so, how) to obtain a reference to the column
    > given a table cell for a datagrid?
    >
    > Zahid
    >
     
    Elton Wang, Oct 3, 2005
    #2
    1. Advertisements

  3. Guest

    foreach (DataGridItem dgi in DataGrid1.Items)
    {
    // this code gives you the rows of the DataGrid
    foreach (Control c in dgi.Controls)
    TableCell tc = (TableCell)c;
    // the code above gets you the cells of the row
    ....
    }

    so we can get any row of the datagrid by using the code
    "DataGrid1.Items"
    where 'i' is the row index...is there similarly a quick way to get a
    column? or once you have a cell, is it possible to get its parent row
    or column...?
     
    , Oct 25, 2005
    #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 Goldin

    Table in a cell of another table

    Mark Goldin, Aug 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    434
    Mark Goldin
    Aug 19, 2004
  2. savvy
    Replies:
    1
    Views:
    626
    savvy
    Jan 18, 2006
  3. Phillip Roncoroni
    Replies:
    14
    Views:
    1,397
    Toby A Inkster
    Apr 5, 2004
  4. Chris
    Replies:
    3
    Views:
    3,877
  5. Replies:
    2
    Views:
    2,776
  6. Replies:
    3
    Views:
    258
  7. Sems
    Replies:
    12
    Views:
    441
  8. Tim Streater
    Replies:
    2
    Views:
    491
    dorayme
    Apr 23, 2014
Loading...