Skip to main content
A newer version of this page is available. .
All docs
V20.2

TreeMapControl.GetItemBounds(ITreeMapItem) Method

Returns a Rectangle object that defines the location of an item passed as a parameter.

Namespace: DevExpress.XtraTreeMap

Assembly: DevExpress.XtraTreeMap.v20.2.UI.dll

NuGet Package: DevExpress.Win.TreeMap

Declaration

public Rectangle GetItemBounds(
    ITreeMapItem item
)

Parameters

Name Type Description
item ITreeMapItem

A TreeMap item whose location is returned.

Returns

Type Description
Rectangle

A Rectangle object that defines the TreeMap item’s location.

Remarks

The following code displays TreeMap item dimensions in item labels:

foreach (ITreeMapItem myItem in treeMap.DataAdapter.Items) {
  TreeMapItem treeMapItem = (TreeMapItem)myItem;
  Rectangle rect = treeMap.GetItemBounds(myItem);
  treeMapItem.Label = String.Format("Width:{0}, Height:{1}", rect.Width.ToString(), rect.Height.ToString());
}
See Also