gridview resize at runtime after databound

Fraser_Admin used Ask the Experts™
i have a gridview which is most of the time larger than the viewable page.  i don't like how it shrinks your columns to fit the grid to the page.  but if i set a static size for the grid, then there is whitespace added to the columns.

how at runtime can i figure out the max space needed for each column, then resize my gridview and columns appropriately?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Analyst Programmer
Computing the viewable page is quite complicated (and probably useless).

Instead, in the gridview's BoundField or TemplateFiled, try set the property ItemStyle-Wrap to "false" to achieve your goal.


that doesn't seem to change anything?
David RobitailleAnalyst Programmer

need some code, screenshot or anything to work with...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial