Exemplo n.º 1
0
 private void treeList_SelectionChanged(object sender, C1TreeViewEventArgs e)
 {
     // set value from first column
     dropDownTreeList.Text = treeList.SelectedNodes.FirstOrDefault()?.GetValue(0)?.ToString();
     // close drop down
     dropDownTreeList.DroppedDown = false;
 }
Exemplo n.º 2
0
        protected override void OnSelectionChanged(C1TreeViewEventArgs e)
        {
            base.OnSelectionChanged(e);
            var newNode = e.Node;

            if (SelectedItem == newNode.GetValue())
            {
                return;
            }
            // collapse previously expanded nodes
            foreach (var n in Nodes)
            {
                if (n.Expanded && !n.Nodes.Contains(newNode))
                {
                    n.Collapse();
                }
            }
            if (newNode.HasChildren)
            {
                // select first child
                newNode.Expand();
                newNode.Nodes[0].Selected = true;
            }
            else
            {
                SelectedItem = newNode.GetValue() as SampleInfo;
                if (ItemClicked != null)
                {
                    ItemClicked(this, new FeatureTreeEventArgs(SelectedItem));
                }
            }
        }
 private void C1TreeView1_CheckStateChanged(object sender, C1TreeViewEventArgs e)
 {
     foreach (C1TreeNode node in e.Node.Nodes)
     {
         node.Checked = e.Node.Checked;
     }
 }
Exemplo n.º 4
0
        private void c1TreeView2_SelectionChanged(object sender, C1TreeViewEventArgs e)
        {
            // set value from first column
            var firstSelectedNode = multiColumnTreeView.SelectedNodes.FirstOrDefault();

            if (firstSelectedNode is not null)
            {
                dropDownMultiColumnTreeView.Text = $"{firstSelectedNode.GetValue(0)} - {firstSelectedNode.GetValue(1)}";
            }
            else
            {
                dropDownMultiColumnTreeView.Text = string.Empty;
            }
            // close drop down
            dropDownMultiColumnTreeView.DroppedDown = false;
        }
Exemplo n.º 5
0
 private void c1TreeView1_SelectionChanged(object sender, C1TreeViewEventArgs e)
 {
     pgNode.SelectedObject = e.Node;
 }
Exemplo n.º 6
0
 private void C1TreeView1_Collapsed(object sender, C1TreeViewEventArgs e)
 {
     e.Node.Images.RemoveAt(0);
     e.Node.Images.Add(0);
 }