Two merged columns in GridView

C

craigkenisston

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 ?
 
W

Winista

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top