Different columns for alternating rows in gridview

Discussion in 'ASP .Net' started by tsedward, Apr 13, 2007.

  1. tsedward

    tsedward Guest

    I am creating a databound gridview. The last cell of each row can,
    and usually does, contain a lot of text. Is there any way that I
    could drop this last cell down into the next line on the gridview?
    This would mean that every other row would ignore the columns and
    consist of one large column. Is this possible?
    tsedward, Apr 13, 2007
    1. Advertisements

  2. Yes, you can do this by intercepting the data binding event and writing a
    second row when it binds that row.
    Cowboy \(Gregory A. Beamer\), Apr 13, 2007
    1. Advertisements

  3. Consider using a repeater instead of a gridview. You can make the item
    template out of two rows and databind in a regular way.

    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    Eliyahu Goldin, Apr 15, 2007
  4. tsedward

    tsedward Guest

    Thanks for both replies. The repeater worked great.
    tsedward, Apr 17, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.