Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
Hello Experts,
I am creating a gridview dynamically. Also the number of columns are created according to database items. And the gridview width is exceeding the main page due to vast number of columns. So I want to display it section wise. Someone please suggest me some solutions.
Thank You
Posted
Comments
thatraja 30-Dec-13 5:00am    
Share the sample screenshot(s). USe imgur.com to image uploads

I would not recommend trying to section it horizontally. I think either shrinking your font size, the column size, or somehow rearranging the layout would be a better option than sectioning.
 
Share this answer
 
HI,

you can do it by this way,

GridView1.Columns[1].ItemStyle.Width = 150;

Or else you can set scrollbar of grid to adjust columns in a section of page.

Also refer this link : http://www.aspdotnet-suresh.com/2013/01/aspnet-set-gridview-column-width.html[^]

Try this.
 
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