Category / Section
How to resolve scrolling position issue in WinForms GridDataBoundGrid?
2 mins read
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
Note:
This is applicable for the GridDataBoundGrid control also.
Screenshot
Samples: