How to get values from treeview checkbox - on which event do I have to write code?
I have code to get values from treeview checkbox. But I am not getting on which event I should write it so that it will work properly. I tried it on treeview1.SelectedNodeChanged
, but it is not working. My code is:
protected void TV_Account_SelectedNodeChanged(object sender, EventArgs e)
{
foreach (TreeNode tn in this.TV_Account.Nodes)
{
if (tn.Checked == true)
开发者_如何学C {
ListBox1.Items.Add(tn.Value);
}
}
}
You are probably looking for the AfterCheck and BeforeCheck events.
精彩评论