Two merged columns in GridView

Discussion in 'ASP .Net' started by craigkenisston@hotmail.com, Jun 14, 2006.

  1. Guest

    I'm not sure if I'm asking something irreverent, so I'm sorry in
    advance.
    But I have a report that should look like :

    Col1 Col2 Col3 Col4
    1 XYZ YUI FIRST_DATA_ASDFASDF
    SECOND_DATA_ASDFASDF
    2 UYI JLU FIRST_DATA_ASDFASDF
    SECOND_DATA_ASDFASDF

    What I mean, is that "first_data" is a column in the database.
    "second_data" is another column in the database, but they are near 400
    char longs and for presentation I was asked to have both on the same
    column, one below the other.
    Is this possible with Gridview ? If so, how ?
     
    , Jun 14, 2006
    #1
    1. Advertising

  2. Winista Guest

    There is no direct solution for this problem but can be done. It will
    require little bit of trick.


    0. Have the grid set up for your 4 column but change third column to header
    something like Column3   column4. This will give user illusion
    that the column is not one column but two.
    1. Handle RowCreated event for the grid.
    2. In the handler, append the text of 4th column with text of 3rd column but
    add <br> tag after 3rd column's text. And at the same time remove the fourth
    column from cell collection.

    Give it a try. It should work.

    Winista
    http://www.universalshoppingmall.com

    <> wrote in message
    news:...
    > I'm not sure if I'm asking something irreverent, so I'm sorry in
    > advance.
    > But I have a report that should look like :
    >
    > Col1 Col2 Col3 Col4
    > 1 XYZ YUI FIRST_DATA_ASDFASDF
    > SECOND_DATA_ASDFASDF
    > 2 UYI JLU FIRST_DATA_ASDFASDF
    > SECOND_DATA_ASDFASDF
    >
    > What I mean, is that "first_data" is a column in the database.
    > "second_data" is another column in the database, but they are near 400
    > char longs and for presentation I was asked to have both on the same
    > column, one below the other.
    > Is this possible with Gridview ? If so, how ?
    >
     
    Winista, Jun 15, 2006
    #2
    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. Mike Hnatt
    Replies:
    2
    Views:
    2,810
    softsan
    Jul 24, 2007
  2. Microsoft_Public

    Javascript two fields merged to one hidden field

    Microsoft_Public, Dec 12, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    595
    Karl Seguin
    Dec 14, 2005
  3. jamesmc
    Replies:
    0
    Views:
    2,619
    jamesmc
    Mar 13, 2006
  4. Javier Vazquez

    JMF: send merged datasource to rtp-target

    Javier Vazquez, Feb 8, 2005, in forum: Java
    Replies:
    4
    Views:
    875
    Roland
    Feb 10, 2005
  5. Cal Who
    Replies:
    0
    Views:
    491
    Cal Who
    Jun 9, 2010
Loading...

Share This Page