开发者

No cursor when resizing datagridview

When i'm trying to resize datagridview columns the resize cursor appears only when i roll over header. However, when i roll over in开发者_JAVA技巧 between cells, resize cursor doesn't show at all.

I have noticed if i set ColumnHeadersVisible = false it fixes the problem and i see resize cursor between columns. However, i need header to be visible, any idea how to make it work all together?


That is the default behavior for DataGridView(and for most Grids). One way to handle your situation, I believe, is to handle that manually; for instance, subclass the grid and, catch the mouse-entering-in-cell event, change the cursor to resize-cursor, and then resize column upon mousedown. Well, just thinking out loud.

--EDIT--

This is in response to your comment. Assuming that by "automated" you mean 'auto resize of columns', please check the .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;

This property lets you configure the control so that column widths are automatically adjusted either to fill the control or to fit cell contents

Also, this answer might help.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜