views:

121

answers:

1

When i'm trying to resize datagridview columns the resize cursor appears only when i roll over header. However, when i roll over in 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?

A: 

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.

KMan
thanks! but is there any automated way that i just missed out?
anya
@anya: Please see my edit in response to your comment.
KMan