PostBack on TreeView Checkbox Click

29 May

The TreeView control included in ASP.Net 2.0 is lacking an option to cause a postback due to a user checking/unchecking a checkbox on a tree node.

I hacked together a little derived class to use in place of the treeview that postsback when the user clicks the checkbox, and also fires an event.

It would of course be useful to add a bit more code so that the resulting event could specify which node was changed, etc.  But as of now you can just look at the “checkednodes” property of the tree. 

Leave a Reply

Your email address will not be published. Required fields are marked *