How to use custom scroll bar for WinForms GridGroupingControl?
Customize the scrollbar
To add a
custom scrollbar in WinForms
GridGroupingControl, you need to set the GridScrollBarMode as shared.
In order to adjust the size of thumb you need to use MetroThumbSize of scrollersFrame.
C#
//to apply custom scrollbar
this.gridGroupingControl1.TableControl.HScrollBehavior = GridScrollbarMode.Shared;
this.scrollersFrame1.AttachedTo = this.gridGroupingControl1.TableControl;
this.scrollersFrame1.VisualStyle = ScrollBarCustomDrawStyles.Metro;
//to adjust the thumb size of scrollbar
this.scrollersFrame1.MetroThumbSize = new Size(5, this.scrollersFrame1.MetroThumbSize.Height);
VB
'to apply custom scrollbar
Me.gridGroupingControl1.TableControl.HScrollBehavior = GridScrollbarMode.Shared
Me.scrollersFrame1.AttachedTo = Me.gridGroupingControl1.TableControl
Me.scrollersFrame1.VisualStyle = ScrollBarCustomDrawStyles.Metro
'to adjust the thumb size of scrollbar
Me.scrollersFrame1.MetroThumbSize = New Size(5, Me.scrollersFrame1.MetroThumbSize.Height)
The screenshots below illustrate the use of a custom scrollbar.
Before customizing the thumb size After customizing the thumb size.
Note:
- If you are using ScrollerFrame, then you need to use AttachedTo and the maximum width of thumb is limited to the up to the size of scroller bounds.
- Instead of using ScrollerFrame, if you want to use any other scrollbars, you can refer this article.
Samples:
C#: CustomScrollBar
VB: CustomScrollBar
Conclusion
I hope you enjoyed learning about how to use custom scroll bar for
WinForms GridGroupingControl.
You can refer to our WinForms GridGroupingControl’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms GridGroupingControl documentation to understand how to present and manipulate data.
For current customers, you can check out our WinForms 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 WinForms GridGroupingControl and other WinForms components.
If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!