Skip to main content
All docs
V25.1
  • SankeyDiagramControl.SelectedItems Property

    Returns the collection of selected Sankey links and nodes.

    Namespace: DevExpress.XtraCharts.Sankey

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

    NuGet Package: DevExpress.Win.Charts

    Declaration

    [Browsable(false)]
    public IList SelectedItems { get; }

    Property Value

    Type Description
    IList

    The collection of selected Sankey links and nodes.

    Remarks

    Add links and nodes to the SelectedItems collection to select them. When you use the SelectedItems property to change the Sankey element selection, the SankeyDiagramControl ignores whether the selection is enabled in the SelectionMode property.

    The following example selects the France node and the related links:

    Sankey elements are selected in the SelectedItems collection

    List<SankeyItem> data = new List<SankeyItem> {
        new SankeyItem { Source = "France", Target = "UK", Value = 53 },
        new SankeyItem { Source = "Australia", Target = "UK", Value = 72 },
        new SankeyItem { Source = "France", Target = "Canada", Value = 81 },
        new SankeyItem { Source = "China", Target = "Canada", Value = 96 },
        new SankeyItem { Source = "UK", Target = "France", Value = 61 },
        new SankeyItem { Source = "Canada", Target = "France", Value = 89 }
    };
    sankeyDiagramControl1.DataSource = data;
    sankeyDiagramControl1.SourceDataMember = "Source";
    sankeyDiagramControl1.TargetDataMember = "Target";
    sankeyDiagramControl1.WeightDataMember = "Value";
    sankeyDiagramControl1.Titles.Add(new SankeyTitle { Text = "Export/Import", Font = new Font("Tahoma", 14) });
    
    sankeyDiagramControl1.SelectedItems.Add("France");
    sankeyDiagramControl1.SelectedItems.Add(data[0]);
    sankeyDiagramControl1.SelectedItems.Add(data[2]);
    sankeyDiagramControl1.SelectedItems.Add(data[5]);
    
    See Also