How to make a datagrid column a row - DOTNET

This is a discussion on How to make a datagrid column a row - DOTNET ; How can I make a datagrid column into a single row that spans all the other columns? In this case I have a comment field that I want to make as wide as the table but I cannot figure out ...

+ Reply to Thread
Results 1 to 3 of 3

How to make a datagrid column a row

  1. Default How to make a datagrid column a row

    How can I make a datagrid column into a single row that spans all the
    other columns?
    In this case I have a comment field that I want to make as wide as the
    table but I cannot figure out how to tell asp.net datagrid that I want
    a new row.

    I am using visual studio 2005,

    Thanks to anybody who has tried this and has a solution

    KB


  2. Default Re: How to make a datagrid column a row

    You may look at using a repeater with 2 rows in the itemtemplate. Something
    like this:

    <asp:repeater>
    <headertemplate>
    <table>
    </headertemplate>
    <itemtemplate>
    <tr runat="server" id="trNormal">
    <td>Databind expression for column 1</td>
    <td>Databind expression for column 2</td>
    <td>Databind expression for column 3</td>
    </tr>
    <tr runat="server" id="trComment">
    <td columnspan=3>Databind expression for comment</td>
    </tr>
    </itemtemplate>
    </asp:repeater>
    <footertemplate>
    </table>
    </footertemplate>

    and handle ItemDataBound event to hide trNormal or trComment as needed.
    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Ken B" <y2kbowen@gmail.com> wrote in message
    news:1190695621.339369.96030@y42g2000hsy.googlegroups.com...
    > How can I make a datagrid column into a single row that spans all the
    > other columns?
    > In this case I have a comment field that I want to make as wide as the
    > table but I cannot figure out how to tell asp.net datagrid that I want
    > a new row.
    >
    > I am using visual studio 2005,
    >
    > Thanks to anybody who has tried this and has a solution
    >
    > KB
    >




  3. Default Re: How to make a datagrid column a row

    Hello Ken,

    U need to handle RowDataBound event making changes to your rows there

    see sample there http://dotnetjunkies.com/WebLog/josh...23/141038.aspx

    ---
    WBR,
    Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo


    KB> How can I make a datagrid column into a single row that spans all
    KB> the
    KB> other columns?
    KB> In this case I have a comment field that I want to make as wide as
    KB> the
    KB> table but I cannot figure out how to tell asp.net datagrid that I
    KB> want
    KB> a new row.
    KB> I am using visual studio 2005,
    KB>
    KB> Thanks to anybody who has tried this and has a solution
    KB>
    KB> KB
    KB>



+ Reply to Thread

Similar Threads

  1. How do I hide a column in a datagrid
    By Application Development in forum CSharp
    Replies: 1
    Last Post: 10-24-2007, 07:33 AM
  2. DataGrid Column Template
    By Application Development in forum DOTNET
    Replies: 0
    Last Post: 08-16-2006, 01:47 PM
  3. Dynamic DataGrid Column
    By Application Development in forum Inetserver
    Replies: 1
    Last Post: 04-04-2006, 09:34 AM
  4. Replies: 0
    Last Post: 02-28-2006, 10:52 PM
  5. Re: Datagrid Column widths (VB.NET)
    By Application Development in forum DOTNET
    Replies: 0
    Last Post: 01-24-2005, 07:05 AM