Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to get rid of the space reserved for images in the TreeListNode when a certain TreeListNode has no images

$
0
0

When the TreeList.SelectImageList or TreeList.StateImageList properties are assigned, each TreeListNode has an indent to draw these images, even if the TreeListNode.SelectImageIndex or TreeListNode.StateImageIndex properties are set to -1.

In a situation when this behavior is undesirable, it's possible to create a custom TreeList descendant, and change it by overriding the TreeListViewInfo.GetDataBoundsLocation method.

Question Comments

Added By: Daniel Parsons at: 7/7/2015 12:06:05 PM    

Corrected code as follows:
protected override void CalcStateImage(RowInfo ri)
       {
           base.CalcStateImage(ri);
           if (Size.Empty != RC.StateImageSize && -1 == ri.Node.StateImageIndex)
               ri.StateImageLocation.X -= RC.StateImageSize.Width;
       }


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>