Ticket T661527
Visible to All Users

Dashboard - ChartDashboardItem Checked Legend not working after upgrading 18.1.5

created 7 years ago (modified 7 years ago)

I have an ChartDashboardItem with Checked Legend in my application.It was working fine in previous version (15.1.12) ,but now its not working after upgrading 18.1.5 version.Please check attached screencast and below Code for for your reference…

Private Sub DashboardViewer1_DashboardItemControlCreated(sender As Object, e As DashboardItemControlEventArgs) Handles DashboardViewer1.DashboardItemControlCreated

If e.ChartControl IsNot Nothing Then
            Dim cl As New DataSet
            cl = KhaDash.GetDataSetForSQLite("Select * from Dashboard Where DName = '" & StrDahboard(3) & "' ", "Dashboard.S3db")
            If cl.Tables(0).Rows.Count > 0 Then
                If cl.Tables(0).Rows(0)("CheckedLegend").ToString() = "1" Then
                    'e.ChartControl.Legend.UseCheckBoxes = True
                    e.ChartControl.Legend.MarkerMode = DevExpress.XtraCharts.LegendMarkerMode.CheckBoxAndMarker
                    AddHandler e.ChartControl.LegendItemChecked, AddressOf ChartControl_LegendItemChecked
                End If
            End If
        End If

End Sub
    Private Sub ChartControl_LegendItemChecked(ByVal sender As Object, ByVal e As DevExpress.XtraCharts.LegendItemCheckedEventArgs)

Dim chartControl1 As ChartControl = CType(sender, ChartControl)
        If TypeOf e.CheckedElement Is Series Then
            Dim series = CType(e.CheckedElement, Series)
            chartControl1.Series(series.LegendText).Visible = e.NewCheckState
        End If

End Sub

Answers approved by DevExpress Support

created 7 years ago (modified 7 years ago)

Hi Junaid,

We changed our internal code related to the chart item, thus your code does not work in version 18.1.5. To resolve this issue modify your code as follows:

Visual Basic
'chartControl1.Series(series.LegendText).Visible = e.NewCheckState chartControl1.Series(series.LegendTextPattern).Visible = e.NewCheckState
    Show previous comments (2)
    JA JA
    Junaid Ahmed 3 7 years ago

      Sorry for late reply…

      As per above code "LegendText" (15.1.12)  has changed to "LegendTextPattern" in 18.1.5 version

      Is there any other Property changes in 18.1.5 compare to 15.1.12  ???

      JA JA
      Junaid Ahmed 3 7 years ago

        Please check the below highlighted code which also not working in 18.1.5 version.

        LookUpEdit edit = (LookUpEdit)view.ActiveEditor;
         edit.Properties.LookUpData.DataSource = null;

        Note:-

        I have used this code in all 150 Forms…

        DevExpress Support Team 7 years ago

          >>Is there any other Property changes in 18.1.5 compare to 15.1.12  ???
          There area many changes in our code since we constantly improve our components and introduce new features. The public API's changes are described on the Breaking Changes (Updating from version 15.1.12 to 18.1.5) page.
          However, the fact that the Chart Dashboard Item now uses the "LegendTextPattern" property instead of "LegendText" is not described there since this change relates to the inner structure of the Dashboard controls. Our internal API can be changed in future versions without notifications. So items customization performed in events described in the Access to Underlying Controls and Access to Underlying Widgets topics may not work after upgrading.

          >>Please check the below highlighted code which also not working in 18.1.5 version.
          It looks like this question is not directly related to the initial post. So I've created a separate ticket on your behalf (T662951: The edit.Properties.LookUpData.DataSource property does not work). It has been placed in our processing queue and will be answered shortly.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.