Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1350
Node image on the right side
posted

Hello,

I have to show a tree like in picture number 1, Nodes with a picture on the left, a node text where the last part is schown in different color (See green circle) and with an image for each node on the right side of the complete tree not on the right side of the node (see red circle).

What I've got so far is shown on picture 2. I can not show the green circle images on the right side and i can not show part of the node text in different color.

Can somebody please point me in the right direction? Can this be done at all?

Thanks for your help.

Regards

Michael

Parents
  • 1350
    Offline posted

    I guess I found out how to do it. I must use a Column-Layout with viewStyle = OutlookExpress

    --------------------------------------------

    UltraTreeColumnSet rootColumnSet = treeDevices.ColumnSettings.RootColumnSet;

    rootColumnSet.Columns.Add("Col1");
    rootColumnSet.Columns.Add("Col2");


    if(rootColumnSet.ExpansionIndicatorColumn == null)
    rootColumnSet.Columns["Col1"].CanShowExpansionIndicator = DefaultableBoolean.True;

    // Hide headers
    rootColumnSet.LabelPosition = NodeLayoutLabelPosition.None;

    // Node text = Col1
    rootColumnSet.NodeTextColumn = rootColumnSet.Columns["Col1"];

    // Always show Expansion icon, no matter if a node has child nodes or not
    treeDevices.NodeLevelOverrides[0].ShowExpansionIndicator = ShowExpansionIndicator.Always;


    // Outlook grid style
    treeDevices.ViewStyle = ViewStyle.OutlookExpress;

    // Stick image column Col2 to the right of the tree control
    rootColumnSet.Columns[1].LayoutInfo.PreferredCellSize = new Size(40, 20);
    rootColumnSet.Columns[0].LayoutInfo.PreferredCellSize = new Size(treeDevices.Width - 40, 20);


    // Populate tree with test data
    FillTree();

    --------------------------------------------------------

    Still two questions:

    1) How can I stick the right column (Col2) to the right of the control? Do I have to recalculate the columns width in the resize event of the control or is there an easier way by setting some properties?

    2) How can I show part of the text in column 1 in different color?

    Thanks

    Regards

    Michael

Reply Children