Back to Devexpress

SankeyDiagramControl.SelectionMode Property

windowsforms-devexpress-dot-xtracharts-dot-sankey-dot-sankeydiagramcontrol-7f6d0e11.md

latest4.3 KB
Original Source

SankeyDiagramControl.SelectionMode Property

Specifies the selection mode for Sankey nodes and links.

Namespace : DevExpress.XtraCharts.Sankey

Assembly : DevExpress.XtraCharts.v25.2.UI.dll

NuGet Package : DevExpress.Win.Charts

Declaration

csharp
public SankeySelectionMode SelectionMode { get; set; }
vb
Public Property SelectionMode As SankeySelectionMode

Property Value

TypeDescription
SankeySelectionMode

A value that defines Sankey selection mode.

|

Available values:

NameDescriptionExample
None

A user cannot select Sankey links and nodes.

|

| | Single |

A user can select a single Sankey link or a node with the related links.

|

| | Multiple |

A user can select multiple Sankey links and nodes.

|

| | Extended |

A user can select a single Sankey link or a node with the related links. A user can hold down the Shift or Ctrl key to select multiple Sankey links and nodes.

|

|

Remarks

The following code allows a user to select multiple Sankey elements:

csharp
private void Form1_Load(object sender, EventArgs e) {
    sankeyDiagramControl1.SelectionMode = SankeySelectionMode.Multiple;
}
vb
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    sankeyDiagramControl1.SelectionMode = SankeySelectionMode.Multiple
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SelectionMode property.

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.

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/SankeyChart/SankeyItemControlProvider.cs#L56

csharp
void Sankey_HighlightedItemsChanged(object sender, SankeyHighlightedItemsChangedEventArgs e) {
    if((sankey.SelectionMode == SankeySelectionMode.Single && e.HighlightedNodes.Count > 0) || e.HighlightedLinks.Any(x => HasSpecialValues(x)))
        sankey.HighlightedItems.Clear();

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/SankeyChart/SankeyItemControlProvider.vb#L65

vb
Private Sub Sankey_HighlightedItemsChanged(ByVal sender As Object, ByVal e As SankeyHighlightedItemsChangedEventArgs)
    If (sankey.SelectionMode = SankeySelectionMode.Single AndAlso e.HighlightedNodes.Count > 0) OrElse e.HighlightedLinks.Any(Function(x) HasSpecialValues(x)) Then
        sankey.HighlightedItems.Clear()

See Also

SankeyDiagramControl Class

SankeyDiagramControl Members

DevExpress.XtraCharts.Sankey Namespace