windowsforms-devexpress-dot-xtracharts-dot-sankey-dot-sankeydiagramcontrol-98b945a0.md
Occurs after a user changes the Sankey selection state and before the SelectedItems collection is changed.
Namespace : DevExpress.XtraCharts.Sankey
Assembly : DevExpress.XtraCharts.v25.2.UI.dll
NuGet Package : DevExpress.Win.Charts
public event SankeySelectedItemsChangingEventHandler SelectedItemsChanging
Public Event SelectedItemsChanging As SankeySelectedItemsChangingEventHandler
The SelectedItemsChanging event's data class is SankeySelectedItemsChangingEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Action | Returns an action that is applied to the SelectedItems collection. |
| Cancel | Indicates whether the SelectedItemsChanging event should be canceled. |
| NewLinks | Returns newly selected Sankey links. |
| NewNodes | Returns newly selected Sankey nodes. |
| OldLinks | Returns previously selected Sankey links. |
| OldNodes | Returns previously selected Sankey nodes. |
Use the e.Cancel property to conditionally cancel the Sankey element selection. The e.NewNodes and e.NewLinks properties contain newly selected nodes and links respectively.
The following example prevents the France node selection:
private void sankeyDiagramControl1_SelectedItemsChanging(object sender, SankeySelectedItemsChangingEventArgs e) {
foreach (SankeyNode node in e.NewNodes) {
if (node.Tag == "France") {
e.Cancel = true;
}
}
}
Private Sub sankeyDiagramControl1_SelectedItemsChanging(ByVal sender As Object, ByVal e As SankeySelectedItemsChangingEventArgs)
For Each node As SankeyNode In e.NewNodes
If node.Tag Is "France" Then
e.Cancel = True
End If
Next
End Sub
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SelectedItemsChanging event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
sankey.ToolTipController = toolTipController;
sankey.SelectedItemsChanging += Sankey_SelectedItemsChanging;
sankey.HighlightedItemsChanged += Sankey_HighlightedItemsChanged;
sankey.ToolTipController = toolTipController
AddHandler sankey.SelectedItemsChanging, AddressOf Sankey_SelectedItemsChanging
AddHandler sankey.HighlightedItemsChanged, AddressOf Sankey_HighlightedItemsChanged
See Also