I'm having an issue with treeview in a web application. I'm trying to generate a treeview based on a users query during run time; therefore I can't preload the treeview with any of these options.
I drag and drop a treeview object within the asp page and then I do all of the population during run time. A stripped down version of my logic is attached.
The issue I have is that in Internet Explorer the Treeview will not expand nor collapse; giving the following error:
"childNodes.0" is null or not an object.
The funny thing is that this works flawlessly in firefox. If anyone could help I'd greatly appreciate it as I've been trying to solve this for a few hours now.
To add (if it helps) if I set root.ExpandAll() I see the whole tree in Internet Explorer and in Firefox; however in Internet Explorer I can't expand or collapse it while in firefox I can.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication3._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<form id="form1" runat="server">
int MAX_RESULTS = 100;
TreeNode children = new TreeNode[MAX_RESULTS];
TreeNode childrenSnippets = new TreeNode[MAX_RESULTS];
TreeNode root = new TreeNode("Google");
for (int i = 0; i < 9; i++)
children[i] = new TreeNode("foo"+i,"","","foo"+i,"");
childrenSnippets[i] = new TreeNode("foo"+i, "", "", "", "");
childrenSnippets[i].SelectAction = TreeNodeSelectAction.None;
<asp:TreeView ID="googleView" runat="server">