TreeMapItem.IsGroup Property
Returns the value that indicates whether the item is a group.
Namespace: DevExpress.XtraTreeMap
Assembly: DevExpress.XtraTreeMap.v24.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.
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;
}
}
}
See Also