C# WinForm 3.5 DataGridView Column Autosize Margin

北城以北 提交于 2019-12-24 08:47:34

问题


I have a C# 3.5 WinForm project, and I can't find where to adjust Margin used for a DataGridView's Header AutoSize.

AutoSizeColumnsMode is set to None. I can resize the column larger or smaller, then double click to AutoResize, and it pops to this width, using the margin illustrated by my awesome paint skills:

How can I adjust the margin used?

回答1:


Something like this: C# AutoSize DatagridView Populated By Linq Query




回答2:


"I want to adjust the margin used by autosizing"

The property used to set a DataGridView's Margin Column size is slightly less obvious:

DataGridView1.RowHeadersWidth = 41;


来源:https://stackoverflow.com/questions/6528552/c-sharp-winform-3-5-datagridview-column-autosize-margin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!