Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.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