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. Advertising

  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. Advertising

  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. 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. savvy
    Replies:
    1
    Views:
    463
    savvy
    Jan 18, 2006
  2. Phillip Roncoroni
    Replies:
    14
    Views:
    1,075
    Toby A Inkster
    Apr 5, 2004
  3. Chris
    Replies:
    3
    Views:
    3,499
  4. Replies:
    2
    Views:
    2,268
  5. Replies:
    3
    Views:
    139
Loading...

Share This Page