树视图加载了来自数据库的一些数据。我想过滤所选组合框项目的树视图。有人告诉我如何执行此操作吗?
public SelectorDataTreeView()
{
InitializeComponent();
button1.FlatStyle = FlatStyle.Flat;
comboBox1.Items.Add("HP");
comboBox1.Items.Add("DELL");
comboBox1.Items.Add("Cam");
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
String s = comboBox1.SelectedItem.ToString();
ExpandAll(MyTreeView.Nodes);
}
//TreeKey Finder
private TreeNode[] FindNode(String searchKey)
{
return MyTreeView.Nodes.Find(searchKey, true);
}
}