Reputation: 41832
I am new to .net. I will try my best to explain the problem. As you can see in the images the columns are resizing which i dont want to happen. I tried giving readonly
property but this doesnt work.
I dont want this to happen
Please also give some suggestions to prevent user from changing the column width.
well this may be a very small issue.
Please help
Thanks in Advance.
Upvotes: 0
Views: 3465
Reputation: 273219
There's a whole set of properties to regulate this exactly.
In code:
dataGridView1.AllowUserToResizeColumns = false;
dataGridView1.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
You will be able to find them in the Properties Window(s) as well. Note the Columns (Collection) [...]
item.
Upvotes: 2