开发者

Disable GridViewColumn Resize

开发者 https://www.devze.com 2023-03-24 06:12 出处:网络
Is there any way by which I can disable GridViewColumn resize in WP开发者_如何学JAVAF? I don\'t want to style the control.See this link: Fixed-Width Column in ListView: A Column that cannot be resized

Is there any way by which I can disable GridViewColumn resize in WP开发者_如何学JAVAF? I don't want to style the control.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号