.net - how to get all selected checkboxes node name in TreeView using c# 4.0? -


i have treeview checkbox in c# windows form based application.the user select item clicking checkboxes in nodes. want selected checkboxes node name whenever clicking getselectedlist button pressed user.how it?.

please guide me out of issue...

you can use simple recursive function:

list<string> checkednames( system.windows.forms.treenodecollection thenodes) {     list<string> aresult = new list<string>();      if ( thenodes != null )     {         foreach ( system.windows.forms.treenode anode in thenodes )         {             if ( anode.checked )             {                 aresult.add( anode.text );             }              aresult.addrange( checkednames( anode.nodes ) );         }     }      return aresult; } 

just use on yourtreeview.nodes


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -