c# - AutoResize Not Working Properly When ColumnHeader Is Longest String -


enter image description here

dgvsampled.autoresizecolumns(datagridviewautosizecolumnsmode.allcells);

i'm trying size columns allcells mode. problem when longest string in column header, buffer left over.

compare requested column coil # column. why coil # column size content, requested column sizes large header title?

after making columns unable sorted, being sized expected them in first place.

enter image description here

from documentation (emphasis mine):

allcells: column widths adjust fit contents of cells in columns, including header cells.

from description, seems want datagridviewautosizecolumnsmode.allcellsexceptheader


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -