How to disable rowheader scaling width?

Is there a way to disable DataGridViewrowheader row resizing without setting AllowUserToResizeRowsto False?

I found row.HeaderCell.Resizable, but he just read.

+4
source share
2 answers

Use the DataGridView.RowHeadersWidthSizeMode property :

Gets or sets a value indicating whether the width of the row headers is adjustable and whether it can be adjusted by the user or automatically adjusted to match the contents of the headers.

myGrid.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
+9
source

Yes, you can do it .. using the code below -

yourDataGridView.Columns[0].Resizable = DataGridViewTriState.False;

datagridview

-1

All Articles