Click here to Skip to main content
15,909,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

i need a small code logic: where based on count of sql rows returned, I need to create a gridview or table. Suppose if Rows.Count=2 , there should be 2 grids or tables one after the other like the chrome layouts. ..

Is there anyone who tried already ????
Posted
Comments
Sriram Ramachandran 16-Apr-14 8:01am    
http://stackoverflow.com/questions/4187354/create-multiple-gridviews-in-code-behind

the website I browsed thought to be useful... But couldn't find the solution
Tom Marvolo Riddle 16-Apr-14 8:08am    
Hi sriram,I didn't do this earlier but it is achievable.

I checked the stack overflow link which you posted.It's looking good

Link posted try it.
What is the exact issue?
Sriram Ramachandran 16-Apr-14 8:14am    
But it didn't worked for me ... My problem is for each row returned from SQL, I need to create a GRIDVIEW ....

1 solution

 
Share this answer
 
Comments
Sriram Ramachandran 16-Apr-14 8:07am    
thanks Jas... Will check it out whether it works for me ...
Tom Marvolo Riddle 16-Apr-14 8:09am    
welcome sriram!.
Sriram Ramachandran 16-Apr-14 8:11am    
I've already checked this code which does creates just one gridview dynamically... But I need for more than 2 gridviews ....
Tom Marvolo Riddle 16-Apr-14 8:19am    
Have a look at this link:
http://www.dotnettips4u.com/2013/03/dynamically-creating-text-boxes-using-c.html[^]

The above link shows how to create multiple textboxes according to the count.Similarly get the count and use loop to create n number of gridview. you have to do similar things and additionally you're creating boundfield.That's it
Sriram Ramachandran 16-Apr-14 8:34am    
@Jas ....
Could you send me ur email id so that I can share my codings and screenshots of my works..

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