[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Collapse]Sunburst Control
   [Expand]Getting Started
    Provide Data
    Colorizers
    Highlight and Select Items
   [Expand]Examples
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Highlight and Select Items

End users can highlight and select sunburst items. The Sunburst control provides an API that allows you to interact with the selected items in code.

Expanded Change the Highlight Mode

The SunburstControl.HighlightMode property specifies that elements are highlighted when the mouse pointer hovers over a sunburst item. The SunburstHighlightMode enumeration lists all the available modes:

Mode

Example

Description

Single

The item is highlighted when the mouse pointer hovers over it.

PathFromRoot (the default mode)

The item and all its parent items are highlighted when the mouse pointer hovers over it.

Use the SunburstControl.GetItemPath method to retrieve items that form the path from the top-level item to the specified item.

WholeGroup

The item and its child items are highlighted when the mouse pointer hovers over it.

None

Elements are not highlighted when they are hovered.

The code below shows how to specify the highlight mode:

Expanded Change the Selection Mode

The HierarchicalChartControlBase.SelectionMode property defines whether end users can select sunburst items. The ElementSelectionMode enumeration lists the available modes:

Mode

Example

Description

Single

Only one element (item or group) can be selected.

Multiple

Multiple items can be selected simultaneously.

Extended

The Extended mode combines the Single and Multiple selection modes' behaviors.

  • Click an item to select it.
  • To select/deselect multiple items, click them while the Ctrl or Shift key is pressed.

None (the default mode)

An end user cannot select sunburst items.

The code below shows how to specify the selection mode:

Expanded Interact with the Selected Items in Code

You can handle the HierarchicalChartControlBase.SelectionChanged event to track whether the selected Sunburst item collection changed.

The following code shows how to use the selected items as a chart's and grid's data source:

The code above uses the following API members:

Member Description
HierarchicalChartControlBase.SelectionChanged Occurs after the selected sunburst items' collection changes.
SelectionChangedEventArgs Provides data for the HierarchicalChartControlBase.SelectionChanged event.
SelectionChangedEventArgs.SelectedItems Returns the selected items' collection.

You can also use the HierarchicalChartControlBase.SelectedItems property to access the selected items' collection.

If the Sunburst control is bound to data using its FlatDataAdapter or HierarchicalDataAdapter, the SelectedItems property returns the data source objects for the selected sunburst items. The SunburstItem.Tag property stores these data source objects.

If the Sunburst control uses ItemStorage, the SelectedItems property stores the selected sunburst items. Note that if the item's Tag property is specified, the SelectedItems stores the Tag property values.

Is this topic helpful?​​​​​​​