TreeView Problem

 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
0
Frozzare
4/21/2009 8:06:03 PM
asp.net.css-control-adapters 905 articles. 0 followers. Follow

1 Replies
179 Views

Similar Articles

[PageSpeed] 53

0
om_prakashp
4/22/2009 5:22:30 AM
Reply:

Similar Artilces:

TreeView and CSS Control Adapters
Hello All,I am using CSS control Adapter for my TreeView. The Intention is to emit <ul> and <li> tags instead of tables.But I am getting this error************************************************************************************** **************************************************************************************Server Error in 'xyz' Application. The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). Description: An unhandled exception occurred during the execution...

CSS Adapter Menu Control Problem
I am using the CSS Adapter Menu Control. I have a menu on the page and is styled by the following CSS file:  /* This style sheet is intended to contain OFTEN CHANGED rules used when the Menu control adapter is enabled. */ /* The menu adapter renders an unordered list (ul) in HTML for each tier in the menu. */ /* So, effectively says: style all tiers in the menu this way... */ ..globalnav { font-family:Arial; font-size: 1em; z-index: 300; } /* The menu adapter generates a list item (li) in HTML for each menu item. */ /* Use this rule create the common appea...

CSS friendly control adapter
Hi All,                     I am using a css file to control the look and feel of the treeview. The issue is the connecting lines are not showing up between nodes. Can some body point out what change needs to be done to my css.   The css content is as below:   .SimpleEntertainmentTreeView div.AspNet-TreeView ul li {white-space: nowrap; padding: 1px 0 1px 0; font-size:inherit;   } .SimpleEntertainmentTreeView div.AspNet-TreeView ul ul {margin: 2px 0 2px 10px; } .Simple...

Problems with CSS Adapters
I do not know why it is not gerenating DIV/CSS but tables instead. I have placed .browser file in my ~/App_Browsers:<browser refID="Default"> <controlAdapters><!--<adapter controlType="System.Web.UI.WebControls.Menu" adapterType="CSSFriendly.MenuAdapter" />--> <adapter controlType="System.Web.UI.WebControls.TreeView"adapterType="CSSFriendly.TreeViewAdapter" /> <adapter controlType="System.Web.UI.WebControls.DetailsView"adapterType="CSSFriendly.DetailsViewAdapter" /> <adapter ...

Trouble controlling .net controlls with CSS
 I am trying to control the :hover css property on <asp: Button> controls. Basically the css is working correctly to set the initial look of the button, but nothing is happening when I hover over the button. Here is my code:CSS:.sidebarButton{    width: 168px;     height: 45px;     background-color: #666666;     text-align: left;    font-weight: bold;    font-family: Century Gothic;    font-size: 13pt;    color: White;    border-style: none;  ...

CSS Friendly Control Adapters + GridView + Update Panel = Problem
Hi everyone,I'm using a gridview control that's bound to an object data source.  I have a couple of controls to filter the data in the gridview, and I'm able to sort and page through the data. Placing it in an UpdatePanel gives me partial page rendering and the whole page doesn't refresh - Great.  Expected behaviour and it all works very well. However, introduce a Control Adapter into the mix (http://www.asp.net/cssadapters/) and Update Panel doesn't work at all - with the whole page refreshing. If anybody can offer any help, I'd be very grateful.  I want both A...

CSS Adapted Treeview control displaying all nodes on page load
Hi. I have decided to use the adapted Treeview control for a project I am working on at the moment. All the control will do is display lists of categories and sub categories, and eventually products at the bottom level. When I load my page up, everything is displayed, rather than the top level nodes. I have taken the control out and placed it in a small test project and exactly the same thing is happening. I am not using the App_Themes folder, I am linking directly to the CSS and Javascript files, and my CSS Treeview Adapter is in it's own .dll file. My code is below. If anyone could giv...

Is CSS Control Adapters compatible with WebPart and WebPartZone controls?
Both WebPart and WebPartZone ultimately derive from WebControl, so it seems like this would work, but before I got into it deeply, was curious if anyone had tried it and if there are any issues? I don't think there is an esay way to make it works. This was a reply from Scott Guthrie: Unfortunately I don't think there is a super easy way to override WebParts -- since some of the layout does assume tables (since the CSS to-do this positioning with divs isn't super easy).  We are going to look at whether it is possible to build another control adapter for webparts in the f...

Problem to use TreeView Control in a 'content page' This Error Occur "Only Content controls are allowed directly in a content page that contains Content controls."
hi I am trying to use the TreeView Control inside the content page (Page that has a master page is a content page). On compiling the project I got the following ASP.Net runtime error: "Only Content controls are allowed directly in a content page that contains Content controls."B@b@R J Issue resolved. I was putting script tag in the content page that is not allowed. when remove the script from content page problem is resolved.B@b@R J...

New Server Control Rendering problem in Vvisual studio.net problem.
Hi every one, when i drag and drop my webserver control to the form in VS.net it shows a very small resizable bounding box type thing, and doesn't show the actual content and size of the control. I want the control to show the actual content and size of the control when i drag it on to the web form. The control works fine when i open the page holding the control in the browser. Can any one help me out here. Thanks. I am assuming that your rendering is being very specific about runtime? Could you shoot some code for your rendering part of the server control?-- Justin Lovell...

Problem with TreeView control inside tabs structure and inside MultiView control
I have web parts inside 2 different 'tab' stuctueres.  In the first one I am using a MultiView control to simulate tabs.  In the second case I'm using some basic javascript and and divs to create my tab structure.  In either case, however, the web parts as well as other Atlas enabled controls (controls within an UpdatePanel) do not seem to work.  The web parts do not even render.  And my control in another tab, which is basically a TreeView wrapped in an UpdatePanel, does not function.  It renders but the navigation stops working.  If anybody has ru...

Problems with Treeview control
1.  I haven't been able to trap any of the tree view events when navigating in the tree on a master page/content page layout.  Specifically, I want to be able to retrieve the selected node in code after it has been clicked - whenever I try to do this from the loaded content page the selected node value returns "nothing".  I assume this is because the content page is actually reloading the master page in  a postback so that the clicked value is no longer available after the postback.  When I try to put code in the selection changed event of the master page, that event...

Problems with Treeview control
Hi everyone, I've recently been charged with fixing some .NET code after a programmer left. Unfortunately, a bug was discovered, and this "TreeView" coding is way over my head. What I need to fix the code below to do is have it populate a TreeView from paths users manually enter in. For example, if a user enters "C:\temp\whatever", "C:\windows", and "C:\temp\whomever", then the tree view should look like: - C: - temp - whatever - whomever - windows Unfortunately, I can only get the cod...

problems with treeview control
hi, i'm facing difficulty in using treeview control which is a part of microsoft internet explorer webcontrols set. its working fine some times. but, when ever u make some changes to the code( not always ), it says ' no relevant source found '. then i remove microsoft.web.ui.webcontrols.dll from references, and again add it to references. then it works fine. wt might be the prob? wud anyone plz help me?thank you..Raj What kinda changes?DNN skins ForumTressleworks modulesDNN & webhostingIEWCtrls...

Treeview control problem
PB 8.0 HasButtons is enabled, but PowerBuilder never displays + and - buttons. What the problem. When adding a treeviewitem to the treeview make sure that the treeviewitem.children property equals TRUE. Brad Taoge wrote: > PB 8.0 > HasButtons is enabled, but PowerBuilder never displays + and - buttons. What > the problem. > > ...

Web resources about - TreeView Problem - asp.net.css-control-adapters

Live-Beta TreeView Demo: Frameless Layout with Highlighting TreeView Demo: Frameless Layout with Highlighting ...
Welcome to our beta site for CBC Live mp3 streams! This is a form of online broadcast we are exploring right now, both from a technical best-practices ...

Visual Basic for Applications - Wikipedia, the free encyclopedia
Visual Basic for Applications ( VBA ) is an implementation of Microsoft 's event-driven programming language Visual Basic 6 and its associated ...

From the Saint
It's full steam ahead for events in the Saint today; although some have been postponed, others are getting bigger and better.

HOME - St. Catharines
St. Catharines is a city that offers many ammenities and opportunities to its residents. It is a place known for its friendliness, charm and ...

CrossFont Help
CrossFont Help

Examples - AlloyUI
AlloyUI is a framework built on top of YUI3 that provides a simple API for building high scalable applications.

allworldsoft.com — all software.
Xara X1 1.1 DL Xara X is an advanced graphic illustration package for Windows, that offers unrivaled redraw speed and a user interface which ...

CrossFont Help
CrossFont Help

Evolution of the Windows Interface
... a 3D button, comboboxes. Windows 95 introduced a slew of new 3D controls, such as rich text edit, toolbars/statusbar, progressbar, treeview/listview, ...

Silverlight - Blackboard
Silverlight is a development platform for creating rich media applications and business applications for the Web, desktop, and mobile devices.Microsoft ...

Resources last updated: 12/24/2015 3:27:02 AM