I'd like to set my WebGrid's columns width to adjust to the width of the cell text, except for the last column. I've tried setting ColWidthDefault to "" and to "0". (FWIW: I'm using AutoGenerateColumns)
Any hints?
TIA
In the DisplayLayout you can set TableLayout to Auto, which will set all column widths to "as wide as it takes". This setting requires StationaryMargins set to No, and UseFixedHeaders set to False
Thanks, rkyllo!
Just in case anyone ever has the same issue:
My next problem was that, using the default borders, I ended up with a ragged right edge, and some missing borders. (see attached screenshot)
In my grid's .DataBound handler, I added this line:
MyGrid.Bands(3).Columns(4).Width = 1550
I would have expected this to push the right edge of the border far off the page, but all it did was clean up the ragged right edge and the "missing borders" problem.
(All of the above is using IG 6.3)