Ask a Question related to ASP.NET General, Design and Development.
-
Srinivasa Raghavan #1
ASP TreeView Control
Hi
I am using ASP Tree View Control to display data in
hiearchy fashion.I am having a checkbox next to the
TreeView Node.When user checks or unchecks the nodes and
click a button i am putting that count in a
stringcollection which is in viewstate.The count is wrong
after certain checks and click of the button.can any one
explain what could be wrong.
Here is the code below.
nodeschecked count is going wrong what could be reason.
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
nodesChecked = New StringCollection()
ViewState("Selected") = nodesChecked
Else
nodesChecked = CType(ViewState("Selected"),
StringCollection)
End If
End Sub
Private Sub TreeView1_Check(ByVal sender As Object, ByVal
e As
Microsoft.Web.UI.WebControls.TreeViewClickEventArg s)
Handles TreeView1.Check
Dim treeView As TreeView
Dim node As TreeNode
Dim strNodeChecked As String
treeView = CType(sender, TreeView)
strNodeChecked = e.Node
node = treeView.GetNodeFromIndex(strNodeChecked)
' the node will have been checked or unchecked
If node.Checked = True Then
nodesChecked.Add(node.Text)
Else
nodesChecked.Remove(node.Text)
End If
End Sub
End Class
Thanks
Srinivasa Raghavan
Srinivasa Raghavan Guest
-
TreeView in Web Custom Control
Hi. I'm trying to develop a web custom control that uses a programmatically created treeview. My problem is that I get an exception when I try to... -
Adding contextmenu to IE Treeview Control
Does anybody have a clue as to how to do this? I would like to display my own custom context menu when rightclicking a node in my treeview, but... -
TreeView Control
Vijay, You can use the TreeView webcontrol that comes with the iewebcontrols which are downloadable from MS site. They are 'unsupported',... -
Problem with Treeview Control & Toolbar
Hi all I have a few problems with my Access 2000 application that I wrote. 1.I have added a Microsoft Treview control version 6.0 control to... -
Having a difficulty working with the Treeview Web Control
Hi, I have answered your question in: microsoft.public.dotnet.framework.aspnet.webcontrols Pls don't do crossposting. Some won't answer your... -
S. Justin Gengo #2
Re: ASP TreeView Control
Srinivasa,
Your code looks fine except for one small thing: In your Sub
TreeView1_Check I don't see where you are saving the new nodesChecked object
to view state. If you don't re-save it to the view state variable every page
load the view state is re-setting it to the empty value.
Change your code to look like this and it will work I think:
' the node will have been checked or unchecked
If node.Checked = True Then
nodesChecked.Add(node.Text)
Else
nodesChecked.Remove(node.Text)
End If
ViewState("Selected") = nodesChecked
Sincerely,
--
S. Justin Gengo, MCP
Web Developer
Free code library at:
[url]www.aboutfortunate.com[/url]
"Out of chaos comes order."
Nietzche
"Srinivasa Raghavan" <s_srinivasa_raghavan@hotmail.com> wrote in message
news:081701c35dab$b9264670$a501280a@phx.gbl...> Hi
>
> I am using ASP Tree View Control to display data in
> hiearchy fashion.I am having a checkbox next to the
> TreeView Node.When user checks or unchecks the nodes and
> click a button i am putting that count in a
> stringcollection which is in viewstate.The count is wrong
> after certain checks and click of the button.can any one
> explain what could be wrong.
>
> Here is the code below.
> nodeschecked count is going wrong what could be reason.
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal
> e As
> System.EventArgs) Handles MyBase.Load
> If Not IsPostBack Then
> nodesChecked = New StringCollection()
> ViewState("Selected") = nodesChecked
> Else
> nodesChecked = CType(ViewState("Selected"),
> StringCollection)
> End If
> End Sub
>
> Private Sub TreeView1_Check(ByVal sender As Object, ByVal
> e As
> Microsoft.Web.UI.WebControls.TreeViewClickEventArg s)
> Handles TreeView1.Check
> Dim treeView As TreeView
> Dim node As TreeNode
> Dim strNodeChecked As String
>
> treeView = CType(sender, TreeView)
> strNodeChecked = e.Node
> node = treeView.GetNodeFromIndex(strNodeChecked)
>
> ' the node will have been checked or unchecked
> If node.Checked = True Then
> nodesChecked.Add(node.Text)
> Else
> nodesChecked.Remove(node.Text)
> End If
>
>
> End Sub
> End Class
>
>
> Thanks
> Srinivasa Raghavan
>
>
>
>
S. Justin Gengo Guest
-
Srinivasa Raghavan Sethuraman #3
Re: ASP TreeView Control
Hi
I am storing cookies in the client side using httpcookie object.It is
working in IE and not in netscape.please suggest a solution.
I am having javascript which works in IE and not in Netscape.Basically
when clicking checkbox in grid i call the javascript.In Netscape the i
am unable to deselected the checkbox once selected.
Thanks
Srinivasa Raghavan
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Srinivasa Raghavan Sethuraman Guest



Reply With Quote

