.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

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -