Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a gridview binded with a datatable which contains data like for ex.
name amount
a 10000
b 20000
c 30000
d 45000 and so on.
my requirement is to display the data in following format.

1st row:- a 10000 b 20000
2nd row:- c 30000
3rd row:- d 45000 e 85000
and so on depending on my conditions.

i m trying to do it in rowdatabound event but not able to achieve the task.
How can i get the complete control over a particular grid row and each cell of it ? what event of grid should i use and how ? Do i have to use any third party control for this ? Help me..


Thanks in advance.
Posted
Updated 2-Dec-13 19:50pm
v3
Comments
Vishal Pand3y 3-Dec-13 1:24am    
not enough Information to answer the question.....
Karthik_Mahalingam 3-Dec-13 1:26am    
Need more info.

your grid view contains only 4 columns or its autogenerated columns ??

how the data will be from database ??
pwavell 3-Dec-13 1:48am    
the columns are autogenerated columns and the table contains more than four columns.i m hiding some columns according to requirement.the columns that datatable contains are
code,name,debit,credit and amount.

1 solution

If your data set is really

VB
a 10000
b 20000
c 30000
d 45000
e 85000


where each one is row back from your data set, then to be able to do something like

CSS
1st row:- a 10000 b 20000
2nd row:- c 30000
3rd row:- d 45000 e 85000


you will need to massage the data going INTO the dataset. Change the results you are getting back to match what you need. This will also help keep business logic out of your UI which is a good practice.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900