I have a treeview control with checkboxes that I need to get the unique identifier value of all checked nodes on a button click. I dont need the control to update until the user actually clicks the button. A stored procedure generates a datatable with the following structure.
SportID SportName LeagueID League
--------------------------
----------
----------
----------
----------
101 Basketball 400 1st Grade
101 Basketball 401 2nd Grade
102 Volleyball 650 Girls Red Div
etc.
The Treeview is build the tree using the code below.
The Treeview displays SportName and League, but the value that I need to retrieve is the LeagueID. Once the user clicks the button, I need a list of all the checked LeagueIDs. In a datagrid I would do something like
For n as integer = 0 to Datagrid.Rows.Count -1
If Datagrid.Rows(n).Cells(5).
Value = true then
LeagueID = Datagrid.Rows(n).Cells("Le
agueID").v
alue
stringbuilder or something with LeagueID
end if
Next.
But I can't seem to find a similar method to work with the treeview.
Thanks,
Clint...
Start Free Trial