public DataTableTreeExample()
        {
            InitializeComponent();
            DataTable table = CreateSampleDataTable();

            this.dataGridView1.Columns.Clear();
            this.dataGridView1.DataSource = table;

            treeViewAdv1.LoadOnDemand = true;
            treeViewAdv1.SelectionMode = TreeSelectionMode.Multi;
            treeViewAdv1.NodeControls.Clear();

            NodeStateIcon ni = new NodeStateIcon();
            ni.DataPropertyName = "Icon";
            treeViewAdv1.NodeControls.Add(ni);

            NodeTextBox tb = new NodeTextBox();
            tb.DataPropertyName = "Text";
            treeViewAdv1.NodeControls.Add(tb);

            
            m_dataTableModel = new DataTableTreeModel(table,"id");
            this.treeViewAdv1.Model = m_dataTableModel;
            this.treeViewAdv1.SelectionChanged += new EventHandler(treeViewAdv1_SelectionChanged);
        }
 private void AddStateIcon() {
     if (tvWorkitems.Columns.Count > 0) {
         var nodeIcon = new NodeStateIcon {DataPropertyName = "Icon", ParentColumn = tvWorkitems.Columns[0]};
         tvWorkitems.NodeControls.Insert(0, nodeIcon);
     }
 }
Example #3
0
        /// <summary>
        /// The constructor that has to be overwritten in the derived model classes
        /// </summary>
        /// <param name="TreeView">The TreeViewAdv control this model is used for</param>
        /// <param name="GrtTree">The GRT tree this model is representing</param>
        /// <param name="StateIcon">The NodeStateIcon Node Control that displays the icon</param>
        /// <param name="DynamicContextMenu">Use context menu definition provided by backend</param>
        protected GrtTreeModel(TreeViewAdv TreeView, MySQL.Grt.TreeModelWrapper GrtTree, Aga.Controls.Tree.NodeControls.NodeStateIcon NodeStateIcon, bool DynamicContextMenu)
            : this(TreeView, GrtTree, DynamicContextMenu)
        {
            nodeStateIcon = NodeStateIcon;

            if (nodeStateIcon != null)
            {
                // Ensure that the VirtualMode is enabled
                nodeStateIcon.VirtualMode = true;

                // Assign virtual value events for displaying and processing the edited value content
                nodeStateIcon.ValueNeeded += new EventHandler <NodeControlValueEventArgs>(StateIconNeeded);
            }
        }
Example #4
0
        /// <summary>
        /// The constructor that has to be overwritten in the derived model classes
        /// </summary>
        /// <param name="TreeView">The TreeViewAdv control this model is used for</param>
        /// <param name="GrtTree">The GRT tree this model is representing</param>
        /// <param name="StateIcon">The NodeStateIcon Node Control that displays the icon</param>
        /// <param name="DynamicContextMenu">Use context menu definition provided by backend</param>
        protected GrtTreeModel(TreeViewAdv TreeView, MySQL.Grt.TreeModelWrapper GrtTree, Aga.Controls.Tree.NodeControls.NodeStateIcon NodeStateIcon, bool DynamicContextMenu)
            : this(TreeView, GrtTree, DynamicContextMenu)
        {
            nodeStateIcon = NodeStateIcon;

              if (nodeStateIcon != null)
              {
            // Ensure that the VirtualMode is enabled
            nodeStateIcon.VirtualMode = true;

            // Assign virtual value events for displaying and processing the edited value content
            nodeStateIcon.ValueNeeded += new EventHandler<NodeControlValueEventArgs>(StateIconNeeded);
              }
        }
 public SimpleGrtTreeModel(TreeViewAdv TreeView, MySQL.Grt.TreeModelWrapper GrtTree, NodeStateIcon nodeIcon, bool DynamicContextMenu)
     : base(TreeView, GrtTree, nodeIcon, DynamicContextMenu)
 {
     model = GrtTree;
       treeControl = TreeView;
 }