Tuesday, May 24th, 2011
I have started the process of creating a Kryptonized version of the TreeView control. As with many of the Krypton controls in the Toolkit it works by using the custom drawing ability of the standard TreeView control. So it will not have any new functionality but should draw in a manner consistent with the rest of the Krypton controls.
So far I have implemented drawing the node text and the tree plus/minus nodes and lines. You can see two examples below, the first using the Office 2010 Blue palette and the second the professional palette.


May 24th, 2011 at 5:08 pm
looking nice… great to see that you’ve started adding controls :)
May 24th, 2011 at 6:37 pm
It would be really nice (and very very important for me) if you could add the possibility to add a text with different font next to the node label, like Outlook does next to mail folder to display how many mails there are. Thanks!
May 24th, 2011 at 10:42 pm
Pl add radio and checkbox button. like IE adv setting options
May 25th, 2011 at 7:41 am
Really nice !
How does it look with 2007 themes ? I think it is the most difficult theme to apply to the treeview
It is really nice to see you were able to change the – + icons of the treeview. I’m curious how do you have achieved this !
Finally are we still able to custom draw the nodes ?
May 25th, 2011 at 9:54 am
Cocotteseb:
I override all the node drawing so I have to draw the plus/minus image and also the lines myself at the correct indentation.
Hitesh:
I will be adding the checkbox drawing with the ability to override the images shown.
Marco Pozzati:
I hope to add the ability to have a second string drawn in a different text/font etc.
May 26th, 2011 at 8:55 am
Looks great… If you are taking requests:
1) add a node enabled property.
2) allow for nodes with or without check boxes.
3) allow for nodes without images to not draw empty space.
4) are tri-state check-boxes useful?
May 26th, 2011 at 6:27 pm
Hi,
It’s look very great :D
Could we select multiple nodes at once?
June 1st, 2011 at 3:08 pm
Please Implement DataSource for the treeview control
June 1st, 2011 at 3:10 pm
Please Implement Datasource to be filled like the below:
public static void SetDataSource(this TreeView tvw, string RootName, Object DataSource, string ValueMember, string DisplayMember, object NodeToSelect = null, Control[] ControlsToClear = null)
{
tvw.BeginUpdate();
tvw.ClearDataSource(ControlsToClear);
TreeNode root = new TreeNode(RootName) { Name = “Root” };
tvw.Nodes.Add(root);
CurrencyManager currencyManager = (CurrencyManager)tvw.BindingContext[DataSource];
if (currencyManager.Count > 0)
{
IList innerList = currencyManager.List;
PropertyDescriptor pdDisplay = currencyManager.GetItemProperties()[DisplayMember];
if (pdDisplay == null) { MsgBox.Error(“Invalid Display Member: ” + DisplayMember, “Unable to set Datasource”); return; }
PropertyDescriptor pdValue = currencyManager.GetItemProperties()[ValueMember];
if (pdDisplay == null) { MsgBox.Error(“Invalid Value Member: ” + ValueMember, “Unable to set Datasource”); return; }
foreach (object record in innerList)
{
string Text = pdDisplay.GetValue(record).ReturnEmptyIfNull();
string Value = pdValue.GetValue(record).ReturnEmptyIfNull();
TreeNode childNode = new TreeNode(Text) { Name = tvw.setName(Value), Tag = record };
root.Nodes.Add(childNode);
}
}
tvw.EndUpdate();
tvw.Format();
if (NodeToSelect != null) { tvw.SelectNode(NodeToSelect.ToString()); tvw.Focus(); }
}