Back to Devexpress

GridView.ScrollAnnotationsStyle Event

windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-gridview-b33084db.md

latest2.3 KB
Original Source

GridView.ScrollAnnotationsStyle Event

Allows you to customize scrollbar annotation color and alignment.

Namespace : DevExpress.XtraGrid.Views.Grid

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Events")]
public event EventHandler<GridScrollAnnotationsStyleEventArgs> ScrollAnnotationsStyle
vb
<DXCategory("Events")>
Public Event ScrollAnnotationsStyle As EventHandler(Of GridScrollAnnotationsStyleEventArgs)

Event Data

The ScrollAnnotationsStyle event's data class is DevExpress.XtraGrid.Views.Grid.GridScrollAnnotationsStyleEventArgs.

Remarks

Note

Show Me Run the Scrollbar Annotations & Bookmarks module in the XtraGrid MainDemo to see the complete example.

Handle the ScrollAnnotationsStyle event to customize scrollbar annotations.

csharp
void OnScrollAnnotationsStyle(object sender, GridScrollAnnotationsStyleEventArgs e) {
    var styleColor = style.GetColor(e.Kind);
    if(!styleColor.IsEmpty)
        e.Color = styleColor;
}
vb
Private Sub OnScrollAnnotationsStyle(ByVal sender As Object, ByVal e As GridScrollAnnotationsStyleEventArgs) Handles gridView.ScrollAnnotationsStyle
    Dim styleColor As Color = style.GetColor(e.Kind)
    If (Not styleColor.IsEmpty) Then
        e.Color = styleColor
    End If
End Sub

See Also

CustomDrawScroll

Scrollbar Annotations

GridView Class

GridView Members

DevExpress.XtraGrid.Views.Grid Namespace