We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to synchronize the selection between the chart and data grid?

Combining a chart with data grid is the most obvious scenario for all real-time dashboards. The following code example explains this.

You can synchronize the data source/items source of the data grid with chart by binding the same data source between the chart and data grid.

You can also synchronically make the selection between the data grid and chart by binding the SelectedIndex (row index) property of data grid with the SelectedIndex property of the chart’s selection behavior as follows.

 

XAML [SfChart]

 

 

 

XAML [Grid]

 

 

 

C# [SfChart]

 

 

 

C# [Grid]

 

 

The following screenshot illustrates the output.

Figure 1: Synchronized SfChart and SfDataGrid.

The following screenshot illustrates the output after the selection has been made on the segment of SfChart.

When a segment in column series is selected using the mouse click, the corresponding SfDataGrid row also will be selected and vice-versa.

 

Figure 2: Synchronized SfChart and SfDataGrid after the selection has been made on the SfChart.

The ListenPropertyChange property should be set to true for listening the update of the properties in the underlying data source.

The following screenshot illustrates the output after editing the data in a cell.

C:\Users\ApoorvahR\Desktop\Note.pngNote: The segment is updated only when the cell loses its focus (since it updates the underlying values after that).

Figure 3: Synchronized SfChart and SfDataGrid after the cell data is changed.

Article ID: Published Date: Last Revised Date: Platform: Control:
3580 01/29/2015 03/13/2018 Silverlight SfChart
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.