how to display datatable columns as rows in datagrid?

Discussion in 'ASP .Net' started by Bob, Aug 1, 2004.

  1. Bob

    Bob Guest

    I have a User table that stores user info (such as first name, last name,
    address etc) in columns, that is, one user per row. However, when
    displaying out for editing one user, I'd like it to be displayed in two
    columns, field names as labels in the left column and field values in
    textboxes in the right column. Could anyone suggest how this can be done
    without looping through the field and adding the row in the datagrid one at
    a time?

    Thanks in advance
    Bob
    Bob, Aug 1, 2004
    #1
    1. Advertising

  2. Bob,

    Instead of using a datagrid try out using a repeater instead.

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    " Bob" <> wrote in message
    news:%...
    > I have a User table that stores user info (such as first name, last name,
    > address etc) in columns, that is, one user per row. However, when
    > displaying out for editing one user, I'd like it to be displayed in two
    > columns, field names as labels in the left column and field values in
    > textboxes in the right column. Could anyone suggest how this can be done
    > without looping through the field and adding the row in the datagrid one

    at
    > a time?
    >
    > Thanks in advance
    > Bob
    >
    >
    S. Justin Gengo, Aug 1, 2004
    #2
    1. Advertising

  3. Bob

    Saber Guest

    As S. Justin said, it is better to use repeater instead, but if you just
    want datagrid here is an article:
    http://www.codeproject.net/cs/database/Vertical_rows_in_Datagrid.asp

    ~~~~~~~~~~~~~~~~~~~~
    Saber S.
    http://maghalat.com (Persian)
    ~~~~~~~~~~~~~~~~~~~~

    " Bob" <> wrote in message
    news:%...
    >I have a User table that stores user info (such as first name, last name,
    > address etc) in columns, that is, one user per row. However, when
    > displaying out for editing one user, I'd like it to be displayed in two
    > columns, field names as labels in the left column and field values in
    > textboxes in the right column. Could anyone suggest how this can be done
    > without looping through the field and adding the row in the datagrid one
    > at
    > a time?
    >
    > Thanks in advance
    > Bob
    >
    >
    Saber, Aug 1, 2004
    #3
  4. Why not just use an HTML table?

    "Saber" <saber[--AT--]maghalat.com> wrote in message
    news:...
    > As S. Justin said, it is better to use repeater instead, but if you just
    > want datagrid here is an article:
    > http://www.codeproject.net/cs/database/Vertical_rows_in_Datagrid.asp
    >
    > ~~~~~~~~~~~~~~~~~~~~
    > Saber S.
    > http://maghalat.com (Persian)
    > ~~~~~~~~~~~~~~~~~~~~
    >
    > " Bob" <> wrote in message
    > news:%...
    > >I have a User table that stores user info (such as first name, last name,
    > > address etc) in columns, that is, one user per row. However, when
    > > displaying out for editing one user, I'd like it to be displayed in two
    > > columns, field names as labels in the left column and field values in
    > > textboxes in the right column. Could anyone suggest how this can be

    done
    > > without looping through the field and adding the row in the datagrid one
    > > at
    > > a time?
    > >
    > > Thanks in advance
    > > Bob
    > >
    > >

    >
    >
    William Gower, Aug 1, 2004
    #4
    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. J. Babe
    Replies:
    1
    Views:
    8,340
    Kevin Spencer
    Aug 15, 2003
  2. helpful sql
    Replies:
    0
    Views:
    808
    helpful sql
    May 19, 2005
  3. Jimmy
    Replies:
    1
    Views:
    3,156
    Eliyahu Goldin
    Jun 14, 2005
  4. arun.11
    Replies:
    0
    Views:
    1,086
    arun.11
    Jul 5, 2011
  5. Jimmy
    Replies:
    2
    Views:
    185
    Kim Quigley
    Jun 16, 2005
Loading...

Share This Page