Problem with DataGridView and scroll position

痞子三分冷 提交于 2019-12-19 10:28:26

问题


I have a DataGridView control inside the Panel. The size of the panel is fixed and AutoScroll is enabled. The problem is that after finishing editing a cell (by pressing Enter or clicking on another cell) the both scrolls of the panel (horizontal and vertical are reseted to start position). This is very inconvenient. How it can be fixed?


回答1:


Why you using DataGridView in Panel? DataGridView have own scrollbars. If you must use it in Panel, set AutoScroll to disabled and dock DataGridView inside.



来源:https://stackoverflow.com/questions/6140355/problem-with-datagridview-and-scroll-position

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!