Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
425
Gauge annotations from code
posted

I have several gauges, each gauge having several annotations. I would like to change the text of one of the annotations programmatically (Vb 2008, IG 9.1 ASP.Net 3.5). How can I do this?

  • 425
    Verified Answer
    posted

    IG Support gave this:

    In order to change the text of annotation at run time, you can use the following code:

    Protected Sub WebImageButton1_Click(ByVal sender As Object, ByVal e As Infragistics.WebUI.WebDataInput.ButtonEventArgs) Handles WebImageButton1.Click
            Dim boxAnnotation1 As New BoxAnnotation()
            boxAnnotation1 = Me.UltraGauge1.Annotations(0)
            boxAnnotation1.Label.FormatString = "Text is changed"
        End Sub

     

    Also, it is possible to hide or show the annotations, thusly:

    CType(gtd.Gauges(0), Infragistics.UltraGauge.Resources.LinearGauge).GaugeComponent.Annotations(7).Visible = False