You really, really don't want to do that. In a website, your C# code is always -
always - executed on the server not the client, and that means that if you handle user interface items in C#, the data has to make a round trip to the server and back to update the display. That's means that the speed of the connection to to the internet at both ends controls how fast the user's action will take before he sees a result - and the more users you have, the slower that gets ...
You really, really, should not be doing this at the server (even if you use Ajax to prevent a whole page postback) - you should do this locally, in javascript.
Start here:
how to Check.uncheck treeview parent and child using javascript? | The ASP.NET Forums[
^] and if that doesn't help, start reading:
checking parent in treeview javascript - Google Search[
^]