How to resolve scrolling position issue in WinForms GridControl or GridDataBoundGrid?
Scrollbar thumbtrack position
By default, the scrollbar’s ThumbTrack position is set based on the column position and row position. But the ThumbTrack is not set to correct position when grid’s RowHeaders and ColumnHeaders are disabled with the RowHeaders and ColumnHeaders property. The following screenshot illustrates the exact issue.
Solution
The vertical scrollbar’s and horizontal scrollbar’s ThumbTrack can be tracked to correct scroll position by enabling the UseOldHiddenScrollLogic static property of the GridControlBase. This property is set before the InitializeComponent() or grid initializing code.
C#
//The following property is enabled above the grid initialization code or InitializeComponent() GridControlBase.UseOldHiddenScrollLogic = true; InitializeComponent();
VB
'The following property is enabled above the grid initialization code or InitializeComponent() GridControlBase.UseOldHiddenScrollLogic = true InitializeComponent
This is applicable for the GridDataBoundGrid control also.
Screenshot
Samples:
C#: ScrollBar_ThumTrack_Position_CS
VB: ScrollBar_ThumTrack_Position_VB
Conclusion
I hope you enjoyed learning about how to resolve scrolling position issue in WinForms GridControl or GridDataBoundGrid.
You can refer to our WinForms Grid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WinForms Grid example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!