示例#1
0
            private void TreeNodeChecked(object sender, RadTreeNodeEventArgs e)
            {
                RadTreeNode node   = e.Node;
                int         termId = int.Parse(node.Value);

                if (node.Checked)
                {
                    //Add Term
                    foreach (Term term in Terms)
                    {
                        if (term.TermId == termId)
                        {
                            SelectedTerms.Add(term);
                            break;
                        }
                    }
                }
                else
                {
                    //Remove Term
                    foreach (Term term in SelectedTerms)
                    {
                        if (term.TermId == termId)
                        {
                            SelectedTerms.Remove(term);
                            break;
                        }
                    }
                }

                //Rebind
                _tree.DataBind();
            }
示例#2
0
        public void BindTerms(List <Term> terms, bool isHeirarchical, bool dataBind)
        {
            _IsHeirarchical = isHeirarchical;

            _ListBox.DataSource  = terms;
            _TreeView.DataSource = terms;

            if (dataBind)
            {
                _ListBox.DataBind();
                _TreeView.DataBind();
            }
        }