Hello. When i click the + button in my treeview i get this error with css adapter:
private void PopulatePages(TreeNode node)
{
SqlCommand sqlQuery = new SqlCommand("Select Pageid, Parentid, Pagetitle from ss_page where parentid = " + node.Value.ToString());
DataSet resultSet;
resultSet = RunQuery(sqlQuery);
if (resultSet.Tables.Count > 0)
{
foreach (DataRow row in resultSet.Tables[0].Rows)
{
TreeNode NewNode = new TreeNode(row["PageTitle"].ToString(), row["pageid"].ToString());
NewNode.PopulateOnDemand = true;
NewNode.NavigateUrl = "/./templates/StandardPage.aspx?id=" + row["pageid"].ToString();
NewNode.SelectAction = TreeNodeSelectAction.SelectExpand;
node.ChildNodes.Add(NewNode);
}
}
} Index was outside the bounds of the array.
Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
|
Stack Trace:
[IndexOutOfRangeException: Index was outside the bounds of the array.] CSSFriendly.TreeViewAdapter.ExpandToState(TreeNodeCollection nodes, String state) +346 CSSFriendly.TreeViewAdapter.OnLoad(EventArgs e) +91 System.Web.UI.Control.LoadRecursive() +8679693 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
|