Grouping indent

Posted by: chrisw on 1 August 2023, 11:26 am EST

  • Posted 1 August 2023, 11:26 am EST

    I have a case where horizontal screen real estate is more valuable than traditional tree visualization and I’d like to set Tree.Indent = 0 but with any value less than 9 it just has 9. Both NodeImage properties are null, so it’s not that.

    Is there any way to override this?

  • Posted 2 August 2023, 4:40 am EST

    Hi Chris,

    If the Tree.Indent property is set to a value smaller than the size of the default images, then the Grid automatically adjusts it to fit the images. The same is mentioned in the description of this property (https://www.grapecity.com/componentone/docs/win/online-flexgrid/C1.Win.FlexGrid.6~C1.Win.FlexGrid.GridTree~Indent.html).

    FYI, the size of the default images is 9, which is the reason why the indent goes to a minimum of size 9. The default images are stored in the C1FlexGrid.Glyphs collection from where you can check the size of these images.

    If you want to reduce the size of the indent, you can either

    (1) Replace the default images with smaller images

    OR

    (2) Replace the default images with black images of size 1

    Please see the attached sample project for reference.

    Attachment: FlexGridTreeIndent.zip

    Best Regards,

    Kartik

  • Posted 2 August 2023, 9:53 am EST

    That mostly works, but the +/- button is gone too. I’m not sure anyone actually used that feature of my previous implementation so this is probably an acceptable tradeoff. I assume there’s a way I can handle the row click and expand/collapse via code if they want that back?

  • Posted 3 August 2023, 1:06 am EST

    Hi,

    Yes, the expand/collapse of nodes can be handled through code using the Node.Collapsed property. We have updated the sample project to toggle the collapsed state using Ctrl+MouseClick on the row

    Attachment: FlexGridTreeIndent_ColExpManual.zip

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels