# C1.Win.FlexGrid.C1FlexGridBase.ScrollBarAnnotationsUpdated

## Content

<div class="doc-site-dotnet-api-container">




<h1 id="C1_Win_FlexGrid_C1FlexGridBase_ScrollBarAnnotationsUpdated" data-uid="C1.Win.FlexGrid.C1FlexGridBase.ScrollBarAnnotationsUpdated" class="text-break">ScrollBarAnnotationsUpdated Event
</h1>
<div class="markdown level0 summary"><p>Fires after the scrollbar annotations are updated.</p>
</div>
<div class="markdown level0 conceptual"></div>
<h6><strong>Namespace</strong>: <a class="xref" href="C1.Win.FlexGrid.html">C1.Win.FlexGrid</a></h6>
<h6><strong>Assembly</strong>: C1.Win.FlexGrid.10.dll</h6>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_ScrollBarAnnotationsUpdated_syntax">Syntax</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public event EventHandler&lt;ScrollBarAnnotationsUpdatedArgs&gt; ScrollBarAnnotationsUpdated</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Event ScrollBarAnnotationsUpdated As EventHandler(Of ScrollBarAnnotationsUpdatedArgs)</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.eventhandler-1">EventHandler</a>&lt;<a class="xref" href="C1.Win.FlexGrid.ScrollBarAnnotationsUpdatedArgs.html">ScrollBarAnnotationsUpdatedArgs</a>&gt;</td>
      <td>Fires after the scrollbar annotations are updated.</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_ScrollBarAnnotationsUpdated_remarks"><strong>Remarks</strong></h5>
<div class="markdown level0 remarks"><p>You can update custom annotations when other annotation types are disabled
by subscribing to this event then calling <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.UpdateScrollBarAnnotations.html#C1_Win_FlexGrid_C1FlexGridBase_UpdateScrollBarAnnotations_System_Boolean_System_Boolean_">UpdateScrollBarAnnotations(bool, bool)</a> method.</p>
</div>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_ScrollBarAnnotationsUpdated_examples"><strong>Examples</strong></h5>
<p>Custom annotations can be added to the list of all grid annotations in the event arguments <a class="xref" href="C1.Win.FlexGrid.ScrollBarAnnotationsUpdatedArgs.html">ScrollBarAnnotationsUpdatedArgs</a>.</p>
<pre><code class="lang-csharp">public enum CustomAnnotationType
{
   Custom1,
   Custom2
}

public class CustomAnnotation : ScrollBarAnnotation
{
   public CustomAnnotationType Type { get; }
   public CustomAnnotation(CustomAnnotationType type, string text, double position, Color? color = null,
       HorizontalAlignment alignment = HorizontalAlignment.Center, int width = 100, int height = 2) :
       base(text, position, color, alignment, width, height)
   {
       Type = type;
   }
}

private void C1FlexGrid1_ScrollBarAnnotationsUpdated(object sender, ScrollBarAnnotationsUpdatedArgs e)
{
   ScrollBarAnnotation customAnnotation = e.Annotations.FirstOrDefault(x =&gt; x is CustomAnnotation ca &amp;&amp; ca.Type == CustomAnnotationType.Custom1);
   var text = $"Custom annotation. Time: {DateTime.Now.ToLongTimeString()}";
   if (customAnnotation == null)
   {
       e.Annotations.Add(new CustomAnnotation(CustomAnnotationType.Custom1, text, 11, Color.Green, width: 70, height: 8));
       e.Annotations.Add(new CustomAnnotation(CustomAnnotationType.Custom2, text, 55, Color.YellowGreen, width: 70, height: -1));
   }
   else
   {
       customAnnotation.Text = text;
   }
}</code></pre>

</div>
