Is there any way by which I can disable GridViewColumn resize in WPF? I don't want to style the control.
Asked
Active
Viewed 8,872 times
2 Answers
8
See this link: Fixed-Width Column in ListView: A Column that cannot be resized
A fixed-width column is a column that cannot be resized by mouse dragging or double-clicks. You can find instances in outlook. Currently two methods can be used to achieve the effect. One is to restyle GridViewColumnHeader to remove the gripper inside its Template. The other is to subclass GridViewColumn to restrict columns' width to a fixed size.

Fredrik Hedblad
- 83,499
- 23
- 264
- 266
-4
Could you explain me in detail and please give me your code.
If you want to disable the column of a GridView , you can use
GridView1.Columns[0].Visible = false;
then column 0 of the grid become disable and the other column of the grid resize automatically.

lelewin
- 559
- 2
- 10
- 26
-
2Visible is NOT a property of a GridViewColumn. – paparazzo Apr 10 '12 at 15:26
-
Visible is NOT a property of a GridViewColumn. thus this solution doesn't work and is incorrect! – Mario Garcia Nov 08 '16 at 10:50