拖放列标题时如何自动滚动dgv? [英] How to automatically scroll the dgv when drag and drop the column header ?

查看:103
本文介绍了拖放列标题时如何自动滚动dgv?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我遇到了一个奇怪的问题。我有datagrid视图,其中包含超过32列。我需要通过拖放列重新排序列。拖放列工作正常。但我的问题是,我可以将选定的列
拖动到可见列(仅在屏幕中可见的前15列),然后手动拖放并滚动dgv,再次拖动选定的列以向32,34列移动。我需要的是,自动滚动dgv(左或右)拖放列。


请帮助解决这个问题。


Manikandan Murugeshan




Manikandan Murugeshan

解决方案

 private void DataGridView1_ColumnAdded(Object sender,DataGridViewColumnEventArgs e){dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.ColumnHeader);} 




Hi All,

I stuck up with one strange issue. I have datagrid view which having more than 32 columns. I need to reorder the columns by drag and drop the columns. Drag and drop of the column is working fine. but my issue is that i can able to drag the selected column to visible column(first 15 columns only visible in screen) and drop and scroll the dgv manually and again drag the selected columns to move towards 32, 34 columns. What i need is , automatically scroll the dgv (left or right) to drag and drop the columns.

Please help to come out of this issue.

Manikandan Murugeshan


Manikandan Murugeshan

解决方案

private void DataGridView1_ColumnAdded(Object sender, DataGridViewColumnEventArgs e) { dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.ColumnHeader);}



这篇关于拖放列标题时如何自动滚动dgv?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆