Vertical DataGrid

Discussion in 'ASP .Net Web Controls' started by Ryan, Jun 26, 2003.

  1. Ryan

    Ryan Guest

    Is there any way to make a datagrid display its data
    vertically? I have a table with about 40 columns which I
    would like to put in a grid of some sort for editing, but
    in the standard datagrid, it stretches way beyond the
    screen. I'd like to display the data, one record at a time
    with the database columns listed vertically on the screen.
    Is there an easy way to do this? A DataList perhaps?

    thanks
     
    Ryan, Jun 26, 2003
    #1
    1. Advertising

  2. Ryan

    N Guest

    Either a DataList or DataGrid would do..

    Personally I prefer datagrids myself.
    In DataGrid, then use the TemplateColumn... just specify the proper bindings
    in the ItemTemplate & EditTemplate sections of the grid.
    A quick example would be as follows...

    <asp:datagrid id=dgSearchResult runat="server">
    <Columns>
    <asp:TemplateColumn>
    <ItemTemplate>
    CustomerNum: <b><%# DataBinder.Eval(Container.DataItem,
    "customerNum")%>)</b><br>
    </ItemTemplate>

    <EditItemTemplate>
    <asp:TextBox runat="server" Text='<%#
    DataBinder.Eval(Container.DataItem, "customerNum") %>'>
    </asp:TextBox>
    </EditItemTemplate>
    </asp:TemplateColumn>
    </Columns>
    </asp:datagrid>

    So, you could have a nested table in the ItemTemplate & EditItemTemplate
    sections...

    Regards,
    Noel Hoo


    "Ryan" <> wrote in message
    news:0db201c33bed$c56dc820$...
    > Is there any way to make a datagrid display its data
    > vertically? I have a table with about 40 columns which I
    > would like to put in a grid of some sort for editing, but
    > in the standard datagrid, it stretches way beyond the
    > screen. I'd like to display the data, one record at a time
    > with the database columns listed vertically on the screen.
    > Is there an easy way to do this? A DataList perhaps?
    >
    > thanks
     
    N, Jun 26, 2003
    #2
    1. Advertising

  3. Ryan

    Ron McNulty Guest

    Best way is to use both. Display a few key fields in the
    grid, and use a single-record DataList to show all the
    fields for the selected record.

    Regards

    Ron

    >-----Original Message-----
    >Is there any way to make a datagrid display its data
    >vertically? I have a table with about 40 columns which I
    >would like to put in a grid of some sort for editing, but
    >in the standard datagrid, it stretches way beyond the
    >screen. I'd like to display the data, one record at a

    time
    >with the database columns listed vertically on the

    screen.
    >Is there an easy way to do this? A DataList perhaps?
    >
    >thanks
    >.
    >
     
    Ron McNulty, Jun 29, 2003
    #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. Ashvin Navare
    Replies:
    0
    Views:
    477
    Ashvin Navare
    Nov 16, 2003
  2. sumit
    Replies:
    3
    Views:
    5,512
    Alvin Bruney
    Nov 18, 2003
  3. Dan Williams

    Vertical datagrid for one record form

    Dan Williams, Apr 15, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,538
    Scott
    Apr 16, 2004
  4. Kenneth Keeley

    Vertical Datagrid

    Kenneth Keeley, Oct 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    441
    A Traveler
    Oct 13, 2004
  5. Mircea Pleteriu

    How to set up a vertical scroll bar for my datagrid control?

    Mircea Pleteriu, Jul 15, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    4
    Views:
    303
    Cristian Suazo
    Jul 17, 2003
Loading...

Share This Page