3 Replies - 10509 Views - Last Post: 08 November 2009 - 07:38 PM Rate Topic: -----

#1 kook88   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 06-November 09

Getting checked checkbox value from tree view

Posted 08 November 2009 - 06:29 PM

hi, i am new to treeview, how to get checked value from tree view? My treeview value is from database.
Is This A Good Question/Topic? 0
  • +

Replies To: Getting checked checkbox value from tree view

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Getting checked checkbox value from tree view

Posted 08 November 2009 - 06:32 PM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.
Was This Post Helpful? 0
  • +
  • -

#3 kook88   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 06-November 09

Re: Getting checked checkbox value from tree view

Posted 08 November 2009 - 07:06 PM

ok,i try this code which i got it from internet but i got a error from Me.Treeview1 which the error is

"Expression is of type 'System.Web.UI.WebControls.TreeView', which is not a collection"

which my code look like this

 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
		For Each tn As TreeNode In Me.TreeView1
			If tn.Checked Then
				Dim s As String = tn.Value
			End If
		Next
	End Sub


Was This Post Helpful? 0
  • +
  • -

#4 kook88   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 06-November 09

Re: Getting checked checkbox value from tree view

Posted 08 November 2009 - 07:38 PM

yeah!! i solve my error which the code look like this

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
		For Each tn As TreeNode In Me.TreeView1.CheckedNodes

			Dim s As String = tn.Value
			TextBox1.Text += s & ","

		Next
	End Sub



Was This Post Helpful? 0
  • +
  • -

Page 1 of 1