Exemple #1
0
        private void vtItems_OnGetNodeCellText(VirtualTreeView.VirtualTreeView tree, VirtualTreeNode node, int column, out string cellText)
        {
            var n = vtItems.GetNodeData <NodeData>(node);

            switch (column)
            {
            case 0: cellText = (n.num).ToString(); break;

            default: cellText = n.name; break;
            }
        }
Exemple #2
0
        private void vtItems_OnCompareNode(VirtualTreeView.VirtualTreeView tree, VirtualTreeNode node1, VirtualTreeNode node2, int column, out int result)
        {
            var n1 = vtItems.GetNodeData <NodeData>(node1);
            var n2 = vtItems.GetNodeData <NodeData>(node2);

            if (column == 0)
            {
                result = n1.num - n2.num;
            }
            else
            {
                result = string.Compare(n1.name, n2.name);
            }
        }
Exemple #3
0
 private void vtItems_OnHeaderClick(VirtualTreeView.VirtualTreeView tree, int column)
 {
     if (column == 0)
     {
         if (sd == SortDirection.sdAscending)
         {
             sd = SortDirection.sdDescending;
         }
         else
         {
             sd = SortDirection.sdAscending;
         }
         tree.SortTree(column, sd);
     }
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemsSourceHierarchicalSource"/> class.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="treeView">The tree view.</param>
 public ItemsSourceHierarchicalSource(IEnumerable source, VirtualTreeView treeView)
 {
     _treeView = treeView;
     Source    = source;
 }
Exemple #5
0
 public Editor(VirtualTreeView tree, VirtualTreeNode node, int column)
 {
     FTree   = tree;
     FNode   = node;
     FColumn = column;
 }
Exemple #6
0
        public DateEditor(VirtualTreeView tree, VirtualTreeNode node, int column) : base(tree, node, column)
        {
            var edit = new DateTimePicker();

            setEdit(edit);
        }
Exemple #7
0
        public TextEditor(VirtualTreeView tree, VirtualTreeNode node, int column) : base(tree, node, column)
        {
            var edit = new TextBox();

            setEdit(edit);
        }