Reputation: 3780
I am filling Datagridview with dataset and Datagridview has all resize properties set to false but, user can even resize rows. How could I disable it?
MyDatagridView.AllowUserToAddRows = False
MyDatagridView.AllowUserToResizeRows = False
MyDatagridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None
...
Upvotes: 0
Views: 3223
Reputation: 34
I realize that this is an old post, but I had exactly the same problem. The AllowUserToResizeRows property may be overridden by the MyDatagridView.RowTemplate.Resizable setting. Try setting both to False, solved the problem for me.
Upvotes: 1
Reputation: 2000
In my experience,
MyDatagridView.AllowUserToResizeRows = False
does always prevents user to resize a row. I don't remember a case when it would be overriden by another property setting (and I use DataGridViews a lot). So I would say the line is not processed (you can debug it) or it is overriden by another setting later (track property value and see when it gets changed).
And by thew way, you can set it in the Datagridview Properties in VisualStudio, to make it a default setting.
Upvotes: 0