Treeview having checkbox

St33L_Di9iTaL

New Member
I have one treeview with checkboxes.I am feeling it dynamically.Here is sample treeview\[code\][]MCA []SEM:1 []Subject []C []OS []DCN []SEM:2 []SEM:3 []Assignment\[/code\]Something like that.MCA is first node.It has 3 child node called SEM-1,SEM-2,SEM-3.SEM-1 also has child called Subject.Subject has 3 child(C,DCN,OS)table structure like this.table1:\[code\]id Name Parentid loginid1 MCA Null 12 SEM-1 1 13 Subject 2 14 C 3 15 OS 3 16 DCN 3 17 SEM-2 1 18 SEM-3 1 1\[/code\]When user select proper user from dropdownlist,treeview should check appropriate checkbox.By executing the query,I am able to find out the id.query1 : select id from table1 where loginid = 1store all id in arraylist.Access one by one using for loop.\[code\]TreeNode node;foreach(int i=0;i<= Treeview.Nodes.count ;i++){ node = this.Treeview.Node; foreach(string str in Arraylist1){ string id = str; if(id= = Node.Value){ Node.check = true;} if(Node== check){ // Select id from table by passing value of id to parentid// select id from table where parentid = id;// user for loop to one by one id// foreach(TreeNode child in Node.childNode){ // Child.value =http://stackoverflow.com/questions/14036233/= above id}}}}\[/code\]It check upto 2 level.But how check inner .Means MCA and SEM part.Not inside part.
 
Back
Top