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
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 headersrootColumnSet.LabelPosition = NodeLayoutLabelPosition.None;// Node text = Col1rootColumnSet.NodeTextColumn = rootColumnSet.Columns["Col1"];// Always show Expansion icon, no matter if a node has child nodes or nottreeDevices.NodeLevelOverrides[0].ShowExpansionIndicator = ShowExpansionIndicator.Always;// Outlook grid styletreeDevices.ViewStyle = ViewStyle.OutlookExpress;// Stick image column Col2 to the right of the tree controlrootColumnSet.Columns[1].LayoutInfo.PreferredCellSize = new Size(40, 20);rootColumnSet.Columns[0].LayoutInfo.PreferredCellSize = new Size(treeDevices.Width - 40, 20);// Populate tree with test dataFillTree();
--------------------------------------------------------
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
Hello Michael,
I am just checking about the progress of this issue. Let me know if you need my further assistance on it.
Thank you for using Infragistics Components.
Sincerely,
Milko
Developer Support Engineer
Infragistics
www.infragistics.com/support
I think you are on the right way. With the help of Creational and Draw filters you can position right images where you need them and paint the text element as you like.
Regarding right image position you can use Creational filter. What you need is to calculate offset for each picture and apply it. Please note you have to increase the parent element (TreeNodeUIElement) width. If you miss this step you will have picture location out of the parent rectangle and it will not be drawn. More about Creation Filter you can find following next link http://help.infragistics.com/Doc/WinForms/current/CLR4.0/?page=Win_Creation_Filter.html
Regarding two color text element you can use Draw Filter. What you need is to calculate the width of black and grey part of the text. After with the help of black and grey brushes (or whatever color you like) you can paint each part of text in different color. More about Draw Filter you can find following next link http://help.infragistics.com/Doc/WinForms/current/CLR4.0/?page=Win_Draw_Filter.html
Please find attached a sample solution implementing what I wrote above.
Please let me know if this is what you are looking for or if I am missing something.