开发者

How to get values from treeview checkbox - on which event do I have to write code?

开发者 https://www.devze.com 2023-03-17 16:48 出处:网络
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 workin

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消