Hi All,
I have a module developed which displays the lists of competencies based on the admin settings. There are different ways to view them and one of them is the treeview.When admin selects this in the settings and updates it i am retrieving the values from db and based on that i am showing the treeview.Here it works fine.And in the main page i have a combo from where user can select the type of view he wants to view the competencies.Here also there is a treeview competencies option as of in the settings.But when selecting the treeview type here the nodes are not expanding and it throws an error like treeview toggle node is not defined.But when the admin sets the view in the settings it works fine though another view is selected and again retrieved back to the treeview.PLEASE HELP.
Heres the code for the function .
Protected Sub populatetreeview()Dim objtreeview As List(Of XWD.Modules.XWD_DNN_CompetencyManager.CompetencyInfo)Dim i, count As Integer
Dim masterString As String
count = objtreeview.Count
masterString =
""
Dim masternode As TreeNode = Nothing
For i = 0 To count - 1If masterString <> objtreeview(i).CatogeryName Then
masterString = objtreeview(i).CatogeryName
masternode =
Treeview1.Nodes.Add(masternode)
New TreeNode(objtreeview(i).CatogeryName.ToString)End If
childnode =
masternode.ChildNodes.Add(childnode)
Dim childnode As TreeNodeNew TreeNode(objtreeview(i).CompetencyName.ToString)If objtreeview.Item(i).AddColumn = 0 And AddRedirect = 0 Then
childnode.NavigateUrl =
childnode.ImageUrl =
"~/default.aspx?tabid=" & UserTabID & "&ctl=EditUserCompetency" & "&mid=" & UserModuleid & "&AddCompetencyId=" & objtreeview.Item(i).CompetencyId"~/images/add.gif"
ElseIf objtreeview.Item(i).AddColumn = 0 And AddRedirect = 1 Then
childnode.NavigateUrl =
childnode.ImageUrl =
"~/default.aspx?tabid=" & UserTabID & "&AddCompetencyId=" & objtreeview.Item(i).CompetencyId"~/images/add.gif"
ElseIf objtreeview.Item(i).AddColumn = 1 And EditRedirect = 0 Then
childnode.NavigateUrl =
childnode.ImageUrl =
"~/default.aspx?tabid=" & UserTabID & "&ctl=EditUserCompetency" & "&mid=" & UserModuleid & "&UserCompetencyId=" & objtreeview.Item(i).UserCompetencyId"~/images/edit.gif"
ElseIf objtreeview.Item(i).AddColumn = 1 And EditRedirect = 1 Then
childnode.NavigateUrl =
""
childnode.ImageUrl =
"~/images/delete.gif"
End If
Next
pnlListCompetencieswithstatus.Visible =
False
pnlCompetencies.Visible =
False
pnlListCompetencieswithcatogery.Visible =
False
pnlLsitCompetenciesbycatogery.Visible =
False
PnlMyCompetencies.Visible =
False
pnlMyCompetencieswithstatus.Visible =
False
pnlMycompetenciesbycatogery.Visible =
False
PnlMyCompetencieswithCatogery.Visible =
False
pnlTreeview.Visible =
True
PnlCategories.Visible =
False
PnlMyCategories.Visible =
False
pnlAvailCategories.Visible =
False
pnlAllUserswithCompetency.Visible =
False
pnlUsersCompetencyspecific.Visible =
False
pnlusersCategoryspecific.Visible =
False
objtreeview = XWD.Modules.XWD_DNN_CompetencyManager.CompetencyController.XWD_CompetencyManager_GetCompetenciesCatogerywise(UserId)