[SOLVED] DGV resizable column headings do not show the correct cursor

Answered Closed
0
0
  • Create a simple DGV bound to a datasource
  • Set the DGV options so users can resize the columns

As you move the cursor along the column headings it will be a hand (mostly) except for the end of the very last column where it will change to a resize. I have seen it once or twice switch to the resize cursor but not very often and I have not been able to pinpoint when it decides to change.

 

  • You must to post comments
Best Answer
0
0

It’s this line:

this.dataGridView1.AutoSizeColumnsMode = Wisej.Web.DataGridViewAutoSizeColumnsMode.AllCells;

Set it to None. When columns are auto sized they are not resizable. Only the Fill is implemented now, all the other modes are completed but still not in since there are a couple of timing issues.

 

  • You must to post comments
0
0

Hi Luca,

Thanks for the video – that is how I was expecting it to work but other than the left hand side of the first column and the far right hand side of the last column the cursor stays as hand (even though I can resize).

I tried changing the LiveResize property but it does not effect what I’m seeing except that as I move left to right the first time the cursor does (sometimes) change to resize.

I’ve attached a simple sample that for me at least has the problem to see if that helps.

Nic

Attachment
  • You must to post comments
0
0

Hi Nic,

The behavior should be this:

  • Columns that can be sorted by clicking on the header show the pointer cursor and are highlighted when hovering (set in the themes)
  • Columns that can be resized show the resize cursor 4px (I think) before and after the right side border.

See small screencast using Tiago’s last sample. I set dataGrid1.LiveResize = true.

http://www.screencast.com/t/berrRW4E3rL

Best,

Luca

  • You must to post comments
Showing 3 results