Node data is not visible in Click event in treeview

1 posts, 0 answers
  1. Devi
    Devi avatar
    50 posts
    Member since:
    May 2007

    Posted 15 Oct 2008 Link to this post


    I'm generating a treeview in page.

    Sub treevwgeneration()
                Dim objDS As New DataSet
                If Session("sesRole") = 2 Then
                    strsql = "select customernum,customername from CRPDM_customer"
                    strsql = strsql & " select projectnum,customernum,projectname from CRPDM_project "
                ElseIf Session("sesRole") = 3 Then
                    strsql = "select customernum,customername from CRPDM_customer where customernum =" & Session("sesCustNum")
                    strsql = strsql & " select projectnum,customernum,projectname from CRPDM_project where customernum =" & Session("sesCustNum")
                ElseIf Session("sesRole") = 1 Or Session("seslogin_userrole") = 0 Then
                    strsql = "select customernum,customername from CRPDM_customer where customernum in(select distinct customernum from CRPDM_allowedprojects where usernum=" & Session("sesUsrNum") & ")"
                    strsql = strsql & " select projectnum,customernum,projectname from CRPDM_project where customernum in(select distinct customernum from CRPDM_allowedprojects where usernum=" & Session("sesUsrNum") & ")"
                End If

                objDS = sa.conn(strSqlConnectionString, strsql, "select", lblMsg)
                objDS.Tables(0).TableName = "dtcust"
                objDS.Tables(1).TableName = "dtproj"
                If objDS.Tables(0).Rows.Count = 0 And objDS.Tables(1).Rows.Count = 0 Then
                    lbl_msg.Text = "Not yet allocated to any Phase."
                    objDS.Relations.Add("custtoproj", objDS.Tables("dtcust").Columns("customernum"), objDS.Tables("dtproj").Columns("customernum"))
                    Dim rowcust, rowProj As DataRow
                    Dim firstcust, firstproj As String
                    'Dim nodecust As New TreeNode
                    'Dim nodeProj As New TreeNode
                    'Dim nodedoc As New TreeNode
                    'Dim nodemsg As New TreeNode
                    'Dim nodeiss As New TreeNode

                    firstcust = objDS.Tables("dtcust").Rows(0)("customernum")
                    firstproj = objDS.Tables("dtproj").Rows(0)("ProjectNum")
                    For Each rowcust In objDS.Tables("dtcust").Rows
                        nodecust = New RadTreeNode
                        nodecust.Text = rowcust("customername")
                        nodecust.Value = rowcust("customernum")
                        If nodecust.Value = firstcust Then
                            nodecust.Expanded = True
                        End If
                        For Each rowProj In rowcust.GetChildRows("custtoproj")
                            nodeProj = New RadTreeNode
                            nodeProj.Text = rowProj("ProjectName")
                            nodeProj.Value = rowProj("Projectnum")
                            If nodeProj.Value = firstproj Then
                                nodeProj.Expanded = True
                                tvwReports.Nodes.Item(0).Selected = True
                                tvwReports.SelectedNode.Visible = True
                            End If
                            nodedoc = New RadTreeNode
                            nodemsg = New RadTreeNode
                            nodeiss = New RadTreeNode

                            nodedoc.Text = "Documents"
                            nodedoc.Value = 0


                            nodemsg.Text = "Messages"
                            nodemsg.Value = 1

                            nodeiss.Text = "Tickets"
                            nodeiss.Value = 2
                End If

            End Sub

    O/p is like this


     Node Click event :

    Protected Sub tvwReports_NodeClick(ByVal o As Object, ByVal e As Telerik.WebControls.RadTreeNodeEventArgs) Handles tvwReports.NodeClick
            End Sub

            Sub tvselindex()
                    ddlIssues.SelectedValue = 0

                    selnode = tvwReports.SelectedNode.UniqueID
                    selind = Split(selnode, ":t")
                    Session("treenode") = tvwReports.SelectedNode.Text

                    If UBound(selind) = 3 Then
                        'chtReport.Visible = True
                        dgReports.Visible = True
                        Dim objds As New DataSet
                        Dim intChkVal As Integer = tvwReports.Nodes(selind(1)).Nodes(selind(2)).Nodes(selind(3)).Value
                        ViewState("cus_num") = tvwReports.Nodes(selind(1)).Value
                        cus_num = ViewState("cus_num")
                        ViewState("pro_num") = tvwReports.Nodes(selind(1)).Nodes(selind(2)).Value
                        pro_num = ViewState("pro_num")
                        ' chtReport.Visible = True
                        dgReports.Visible = True
                        strsql = ""
                        If intChkVal = 0 Then
                            strsql = "select Cu.customerName[Customer],Pr.ProjectName [Project],Ph.Phasename [Phase],SPh.SubPhasename [Subphase],Cd.Docname [Document],left(Cd.senddate,11) [Send Date],U.UserId [From] from CRPDM_customerdoc cd left join CRPDM_customer Cu on cd.customernum=cu.customernum left join CRPDM_Project Pr on cd.projectnum=Pr.projectnum left join CRPDM_Phase Ph on cd.Phasenum=Ph.phasenum left join CRPDM_Subphase SPh on cd.SubPhasenum=Sph.subphasenum left join CRPDM_usersecurity U on cd.ownernum=U.usernum where cd.customernum=" & cus_num & " and cd.projectnum=" & pro_num & " and cd.docname is not null"

                        lblMsg.Text = "Please Select  documents/messages/tickets to view reports"
                        '' lblmsg.Visible = True
                        'chtReport.Visible = False
                        dgReports.Visible = False
                    End If
                    tvwReports.SelectedNode.ToolTip = tvwReports.SelectedNode.Text
                    tvwReports.SelectedNode.Selected = True

                Catch ex As Exception

                End Try
            End Sub

    Now my problem is if i click the any child node under Lclite..

    the node is invisible...but the value is there. 

    pls give me any suggestion for this problem....

    Thanks ,
    Devipriya A.K.

Back to Top