c# - Move column in DataGridView without clicking on it twice -


normally, move column in datagridview, click , drag. however, if scroll before operation (which quite common if moving columns), must click on column before click-and-drag. thought had datagridview losing focus, listened scroll events of type endscroll horizontal scroll bar , called focus() on datagridview there. did not work. know how can move columns without click in case?

this looks winforms bug.

decompiling system.windows.forms helped me find solution : declare datagridview child class , override onscroll function way :

protected override void onscroll(scrolleventargs e) {     base.onscroll(e);     base.onmouseup(new mouseeventargs(mousebuttons.left, 1, 0, 0, 0)); } 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -