Articles in this section

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 the correct position when grid’s RowHeaders and ColumnHeaders are disabled with the RowHeaders and ColumnHeaders property. The following screenshot illustrates the exact issue.


Show the scrollbar in horizontal and vertical with unwanted space

Solution

The vertical scrollbars 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.

//The following property is enabled above the grid initialization code or InitializeComponent()
GridControlBase.UseOldHiddenScrollLogic = true;
InitializeComponent();
'The following property is enabled above the grid initialization code or InitializeComponent()
GridControlBase.UseOldHiddenScrollLogic = true
InitializeComponent 

Note:

This is applicable to the GridDataBoundGrid control also.

 

The screenshot below illustrates the scrollbar Thumb Track position in GridControl.

Show the scrollbar in horizontal and vertical without unwanted space


Samples:

C#: ScrollBar_ThumTrack_Position_CS

VB: ScrollBar_ThumTrack_Position_VB

 

Conclusion

I hope you enjoyed learning about how to resolve the scrolling position issue in WinForms GridControl.

You can refer to the WinForms GridControl feature tour page to know about its other groundbreaking feature representations and WinForms GridControl documentation, and how to quickly get started for configuration specifications. You can also explore our WinForms GridControl 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 clarification, 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!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied