Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
627
Column width in webGrid
posted

Hi,

I'm using webGrid and I would like the column width to be scaled to fit it's content or header (the biggest string).

meaning I don't want all of the columns to have uniform width but to match it's content or header.

Thanks

Maya

Intel

Parents
No Data
Reply
  • 45049
    posted

    So long as your grid's DisplayLayout.TableLayout is set to Auto, then columns will increase their size to fit their content in this way, just as it would for an HTML table.  They won't decrease in size, however.

    If your DisplayLayout.TableLayout is set to Fixed, then this won't occur, nor do I know of a way to auto-size columns in this fashion.  Again, this is the same for an HTML table.  This is important to note because a Fixed table layout is required if you're using either stationary margins or fixed column headers.

Children