TreeMapItem.IsGroup Property
Returns the value that indicates whether the item is a group.
Namespace: DevExpress.XtraTreeMap
Assembly: DevExpress.XtraTreeMap.v18.2.dll
Declaration
Property Value
Type | Description |
---|---|
Boolean | true if the item is a group; otherwise false. |
Example
The following properties allow you to customize tooltips.
- HierarchicalChartControlBase.ShowToolTips - specifies whether or not tooltips should be shown.
- TreeMapControl.ToolTipLeafPattern - specifies a text pattern that can be used to format the text of a tooltip displayed for leaf items.
- TreeMapControl.ToolTipGroupPattern - specifies a text pattern that can be used to format the text of a tooltip displayed for group items.
- HierarchicalChartControlBase.ToolTipController - allows you to specify a ToolTipController instance used to display tooltips.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-customize-treemap-tooltips-t361925
using DevExpress.Utils;
using DevExpress.XtraTreeMap;
using System;
using System.Windows.Forms;
namespace ToolTipCustomization {
public partial class Form1 : Form {
const String GroupToolTipText = "Place the cursor over an item to obtain information about it.";
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
chkShowTooltip.Checked = treeMap.ShowToolTips;
treeMap.ToolTipLeafPattern = "{L} : {V:C1} trillions";
treeMap.ToolTipGroupPattern = GroupToolTipText;
}
private void chkShowTooltip_CheckedChanged(object sender, EventArgs e) {
treeMap.ShowToolTips = chkShowTooltip.Checked;
}
private void chkTooltipController_CheckedChanged(object sender, EventArgs e) {
treeMap.ToolTipController = (chkTooltipController.Checked) ? toolTipController1 : null;
}
private void toolTipController1_BeforeShow(object sender, ToolTipControllerShowEventArgs e) {
TreeMapItem item = e.SelectedObject as TreeMapItem;
if(item == null) return;
if(item.IsGroup) return;
SuperToolTip superTip = new SuperToolTip { AllowHtmlText = DefaultBoolean.True };
superTip.Items.Add(new ToolTipTitleItem { Text = String.Format("{0} statistics", item.Label) });
superTip.Items.Add(new ToolTipSeparatorItem());
superTip.Items.Add(new ToolTipItem { Text = String.Format("<b>GDP (2014):</b> {0:C1} trillions", item.Value) });
e.SuperTip = superTip;
}
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the IsGroup 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.