Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please Help me with Treeview control

Status
Not open for further replies.

mbhavani

Programmer
Nov 10, 2003
11
0
0
IN
I had a treeiew control and a usercontrol on my web page.The "Expand Level" property of that treeview control is set to '0'.When I run the page ,If I select any node at level 1 or higher in the treeview, and I click on the userControl, then I'am getting this error:


The node at index 1.0 is not currently displayed in the tree. SelectedNodeIndex cannot be set to an undisplayed node (all parents of a selected node must be expanded).

I'am handling the treeview's "OnClick", "OnExpand" and "OnCollapse" events in javascript.But I'am not doing anything with treeview control.It is not going to CodeBehind before giving this error.I'am frustated.Please anyone Help me.
Thankyou
 
mb: I've worked with treeview a bit; but not with java controlling; sounds interesting; if no one comes back with a solution post your code an snippet of the Treeview code - I'd like to test it.
 
Sorry for the delay,
No one replied to me except you,

Here is my html code,


<%@ Register TagPrefix=&quot;uc1&quot; TagName=&quot;LMSWelcome&quot; Src=&quot;LMSWelcome.ascx&quot; %>
<%@ Register TagPrefix=&quot;uc1&quot; TagName=&quot;LMSTopBanner&quot; Src=&quot;LMSTopBanner.ascx&quot; %>
<%@ Page Language=&quot;vb&quot; AutoEventWireup=&quot;false&quot; Codebehind=&quot;LMSLessonPage.aspx.vb&quot; Inherits=&quot;ThinClientInterface.LMSLessonPage&quot;%>
<%@ Register TagPrefix=&quot;uc1&quot; TagName=&quot;LMSStudentMenu&quot; Src=&quot;LMSStudentMenu.ascx&quot; %>
<%@ Register TagPrefix=&quot;iewc&quot; Namespace=&quot;Microsoft.Web.UI.WebControls&quot; Assembly=&quot;Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; %>
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<HTML>
<HEAD>
<title>Launch Lesson</title>
<LINK href=&quot;styles.css&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot;>
<meta content=&quot;Microsoft Visual Studio.NET 7.0&quot; name=&quot;GENERATOR&quot;>
<meta content=&quot;Visual Basic 7.0&quot; name=&quot;CODE_LANGUAGE&quot;>
<meta content=&quot;JavaScript&quot; name=&quot;vs_defaultClientScript&quot;>
<meta content=&quot; name=&quot;vs_targetSchema&quot;>
<script language=&quot;javascript&quot; src=&quot;Help/MapIDs.js&quot;></script>
<script language=&quot;javascript&quot; src=&quot;Help/Student/CallHelp.js&quot;></script>
<script language=&quot;javascript&quot; src=&quot;Help/RoboHelp_CSH.js&quot;></script>
<script language=&quot;javascript&quot;>

</script>
<script id=&quot;clientEventHandlersJS&quot; language=&quot;javascript&quot;>
<!--

var i = 0
function RefreshLessonTree()
{
//alert(&quot;RefreshLessonTree&quot;);
if(i == 1 )
{
window.navigate(window.document.URLUnencoded);
}
else
i = i + 1;
}
function window_onload() {
//alert(&quot;window_onload&quot;);
}
function window_onfocus() {
RefreshLessonTree();
}
function tv_onClick()
{
i = 1;
}
function tv_onCollapse()
{
i = 0;
}
function tv_onExpand()
{
i = 0;
}

//-->
</script>
</HEAD>
<body id=&quot;BlueBg&quot; MS_POSITIONING=&quot;GridLayout&quot; language=&quot;javascript&quot; oncontextmenu=&quot;return false;&quot; onload=&quot;return window_onload()&quot; onfocus=&quot;return window_onfocus()&quot;>
<form id=&quot;Form1&quot; method=&quot;post&quot; runat=&quot;server&quot;>
<TABLE id=&quot;Table4&quot; style=&quot;Z-INDEX: 103; LEFT: -10px; POSITION: absolute; TOP: -5px&quot; cellSpacing=&quot;0&quot; cellPadding=&quot;0&quot; border=&quot;0&quot;>
<TR>
<TD>
<uc1:LMSTopBanner id=&quot;LMSTopBanner1&quot; runat=&quot;server&quot;></uc1:LMSTopBanner></TD>
</TR>
</TABLE>
<INPUT id=&quot;txtLegacy&quot; style=&quot;Z-INDEX: 104; LEFT: 550px; VISIBILITY: hidden; WIDTH: 18px; POSITION: absolute; TOP: 15px; HEIGHT: 22px&quot; type=&quot;text&quot; size=&quot;1&quot; value=&quot;0&quot; name=&quot;txtLegacy&quot; runat=&quot;server&quot;>
<TABLE id=&quot;Table9&quot; style=&quot;Z-INDEX: 104; LEFT: 192px; WIDTH: 758px; POSITION: absolute; TOP: 129px; HEIGHT: 224px&quot; borderColor=&quot;black&quot; cellSpacing=&quot;1&quot; cellPadding=&quot;1&quot; width=&quot;738&quot; border=&quot;1&quot;>
<TR>
<td valign=&quot;center&quot; bgColor=&quot;#a6a592&quot; style=&quot;WIDTH: 63px&quot;>
<asp:label id=&quot;lblSelCourseName&quot; runat=&quot;server&quot; CssClass=&quot;clsBlueBoldLabel_12&quot; ForeColor=&quot;Black&quot; Height=&quot;14&quot; Width=&quot;684px&quot;>System Statistics</asp:label>
</td>
<td valign=&quot;center&quot; bgColor=&quot;#a6a592&quot; style=&quot;WIDTH: 3px; HEIGHT: 26px&quot;>
<asp:HyperLink id=&quot;HlNotepad&quot; runat=&quot;server&quot; Width=&quot;25px&quot; ToolTip=&quot;Notepad&quot; ImageUrl=&quot;Icons/Notepad.gif&quot; Target=&quot;_self&quot;>Notepad</asp:HyperLink>
</td>
<td valign=&quot;center&quot; bgColor=&quot;#a6a592&quot; style=&quot;WIDTH: 3px;HEIGHT: 26px&quot;>
<asp:HyperLink id=&quot;HPrintNotes&quot; runat=&quot;server&quot; Width=&quot;25px&quot; ToolTip=&quot;Print Notes&quot; ImageUrl=&quot;Icons/printer_s.jpg&quot; Target=&quot;_self&quot;>Notepad</asp:HyperLink>
</td>
</TR>
<TR>
<td colspan=&quot;3&quot; align=&quot;left&quot; bgColor=&quot;wheat&quot; borderColor=&quot;#e6e6fa&quot;>
<P>
<asp:label id=&quot;lblMsg&quot; runat=&quot;server&quot; ForeColor=&quot;Crimson&quot; CssClass=&quot;clsErrorMessage&quot; Width=&quot;812px&quot; BorderColor=&quot;Transparent&quot; BorderStyle=&quot;None&quot; Visible=&quot;False&quot; BackColor=&quot;Transparent&quot;></asp:label></P>
<P>
<iewc:treeview id=&quot;tvLessonStructure&quot; runat=&quot;server&quot; BorderStyle=&quot;Solid&quot; Height=&quot;400px&quot; Width=&quot;815px&quot; BorderColor=&quot;Black&quot; ShowLines=&quot;False&quot; BorderWidth=&quot;1px&quot; SelectExpands=&quot;True&quot; ShowPlus=&quot;False&quot;>
<iewc:TreeNodeType DefaultStyle=&quot;font-weight:normal;font-size:15px;color:black;font-family:Tahoma;&quot; Type=&quot;blockCBT&quot;></iewc:TreeNodeType>
<iewc:TreeNodeType DefaultStyle=&quot;font-weight:normal;font-size:15px;color:black;font-family:Tahoma;&quot; Type=&quot;lessonCBT&quot;></iewc:TreeNodeType>
</iewc:treeview></P>
</td>
</TR>
<tr>
<td colspan=&quot;3&quot; borderColor=&quot;lavender&quot; style=&quot;HEIGHT: 41px&quot;>
<table style=&quot;FONT-WEIGHT: bold; FONT-SIZE: 10px; WIDTH: 815px; COLOR: black; FONT-FAMILY: Tahoma; HEIGHT: 40px; BACKGROUND-COLOR: #a6a592&quot; borderColor=&quot;lightsteelblue&quot; borderColorDark=&quot;#b0c4de&quot; width=&quot;815&quot; borderColorLight=&quot;#b0c4de&quot;>
<tr>
<td vAlign=&quot;center&quot; style=&quot;WIDTH: 160px&quot;>
<asp:Image id=&quot;Image6&quot; runat=&quot;server&quot; Height=&quot;17px&quot; Width=&quot;17px&quot; ImageUrl=&quot;Icons/Globe.gif&quot;></asp:Image>
<FONT style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 11pt; FONT-FAMILY: Tahoma&quot;>WBT</FONT>
</td>
<td vAlign=&quot;center&quot; style=&quot;WIDTH: 160px&quot;>
<asp:Image id=&quot;Image7&quot; runat=&quot;server&quot; Height=&quot;17px&quot; Width=&quot;17px&quot; ImageUrl=&quot;Icons/CD.gif&quot;></asp:Image><FONT style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 11pt; FONT-FAMILY: Tahoma&quot;>CBT</FONT>
</td>
</tr>
<tr>
<td vAlign=&quot;center&quot; style=&quot;WIDTH: 160px&quot;>
<asp:Image id=&quot;Image4&quot; runat=&quot;server&quot; Height=&quot;17px&quot; Width=&quot;17px&quot; ImageUrl=&quot;Icons/block.gif&quot;></asp:Image><FONT style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 11pt; FONT-FAMILY: Tahoma&quot;>
Block</FONT>
</td>
<td vAlign=&quot;center&quot; style=&quot;WIDTH: 160px&quot;>
<asp:Image id=&quot;Image5&quot; runat=&quot;server&quot; Height=&quot;17px&quot; Width=&quot;17px&quot; ImageUrl=&quot;Icons/Lessons.gif&quot;></asp:Image><FONT style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 11pt; FONT-FAMILY: Tahoma&quot;>Lesson</FONT>
</td>
</tr>
<tr>
<td vAlign=&quot;center&quot; style=&quot;WIDTH: 160px&quot;>
<asp:Image id=&quot;Image1&quot; runat=&quot;server&quot; Height=&quot;17px&quot; Width=&quot;17px&quot; ImageUrl=&quot;Icons/NotAttempted.gif&quot;></asp:Image><FONT style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 11pt; FONT-FAMILY: Tahoma&quot;>Not
Attempted</FONT>
</td>
<td vAlign=&quot;center&quot; style=&quot;WIDTH: 160px&quot;>
<asp:Image id=&quot;Image2&quot; runat=&quot;server&quot; Height=&quot;17px&quot; Width=&quot;17px&quot; ImageUrl=&quot;Icons/InComplete.gif&quot;></asp:Image><FONT style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 11pt; FONT-FAMILY: Tahoma&quot;>Incomplete</FONT>
</td>
<td vAlign=&quot;center&quot; style=&quot;WIDTH: 160px&quot;>
<asp:Image id=&quot;Image3&quot; runat=&quot;server&quot; Height=&quot;17px&quot; Width=&quot;17px&quot; ImageUrl=&quot;Icons/Complete.gif&quot;></asp:Image><FONT style=&quot;FONT-WEIGHT: normal; FONT-SIZE: 11pt; FONT-FAMILY: Tahoma&quot;>Complete</FONT>
</td>
</tr>
</table>
</td>
</tr>
<tr bordercolor=&quot;#003300&quot;>
<td colspan=&quot;3&quot; style=&quot;HEIGHT: 40px&quot; align=&quot;middle&quot;>
<asp:Button id=&quot;btnBack&quot; runat=&quot;server&quot; Width=&quot;110px&quot; Text=&quot;<< Back&quot; Height=&quot;25px&quot; CssClass=&quot;clsSubmitButton&quot;></asp:Button>
</td>
</tr>
</TABLE>
<asp:panel id=&quot;pnlMenu&quot; style=&quot;Z-INDEX: 101; LEFT: -1px; POSITION: absolute; TOP: 48px&quot; runat=&quot;server&quot; Width=&quot;185px&quot; CssClass=&quot;clsPanel&quot; Height=&quot;600px&quot;>
<TABLE id=&quot;Table2&quot; style=&quot;WIDTH: 185px; HEIGHT: 40px&quot; borderColor=&quot;#000000&quot; cellSpacing=&quot;0&quot; cellPadding=&quot;0&quot; width=&quot;174&quot; border=&quot;0&quot;>
<TR height=&quot;64&quot;>
<TD style=&quot;BACKGROUND-REPEAT: repeat-x&quot; vAlign=&quot;top&quot; background=&quot;Images/red-top-edge.jpg&quot;></TD>
</TR>
<TR height=&quot;660&quot;>
<TD style=&quot;BACKGROUND-REPEAT: repeat-y&quot; vAlign=&quot;top&quot; background=&quot;Images/big-horizontal-red-line.jpg&quot;>
<uc1:LMSStudentMenu id=&quot;usrCtrlStudentMenu&quot; runat=&quot;server&quot;></uc1:LMSStudentMenu></TD>
</TR>
</TABLE>
</asp:panel>
<TABLE id=&quot;Table3&quot; style=&quot;Z-INDEX: 102; LEFT: 184px; POSITION: absolute; TOP: 48px&quot; cellSpacing=&quot;0&quot; cellPadding=&quot;0&quot; width=&quot;300&quot; border=&quot;0&quot;>
<TR>
<TD>
<uc1:LMSWelcome id=&quot;LMSWelcome1&quot; runat=&quot;server&quot;></uc1:LMSWelcome></TD>
</TR>
</TABLE>
</form>
</body><script src=&quot;LMSChildWindowSettings.js&quot; language=&quot;javascript&quot; type=&quot;text/javascript&quot;></script>
</HTML>



I'am not doing anything with treeview control in my codebehind except populating it in pageload event.

Thankyou very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top