private void CheckItem(TreeListItemCollection items, object[] values, List <string> texts) { foreach (var item in items) { if (values.Contains(GetValue(item))) { item.Checked = true; texts.Add(GetDisplayText(item)); } CheckItem(item.Items, values, texts); } }
private bool FindItem(TreeListItemCollection items, object value) { foreach (var item in items) { if (object.Equals(GetValue(item), value)) { item.Selected = true; base.SelectedValue = value; SetText(GetDisplayText(item)); return(true); } if (FindItem(item.Items, value)) { return(true); } } return(false); }
internal void Update(TreeList treelist) { TreeList = treelist; Items = new TreeListItemCollection(treelist, null, 0); }