This is a migrated thread and some comments may be shown as answers.

RadTreeView is not displaying the +/- nor checkboxes

2 Answers 85 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
scott
Top achievements
Rank 1
scott asked on 01 Oct 2015, 02:45 AM

I don't know what happened, we had it working but with some UI changes, it stopped working properly.  So, I tried to create a new file, to rule out all the CSS, and to isolate just the RadTreeView and it's still not behaving as expected.  Here's what I have in the .aspx page.

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchForm.aspx.cs" Inherits="Cnet_Forum.SearchForm" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:radscriptmanager runat="server" id="RadScriptManager1">
        <Scripts>
            <asp:ScriptReference Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                Name="MicrosoftAjax.js" Path="https://ajax.microsoft.com/ajax/4.0/MicrosoftAjax.js" />
        </Scripts>
    </telerik:radscriptmanager>
    <div>
    <div class="panel-expand">
                <telerik:RadTreeView ID="area_tree_view" runat="server" runat="server" CheckBoxes="True" TriStateCheckBoxes="True" 
                    CheckChildNodes="true" MultipleSelect="True" >
                </telerik:RadTreeView>
            </div>
    </div>
    </form>
</body>
</html>

And the code-behind page:

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DbforumData;
using DbforumData.dataset;
using Telerik.Web.UI;

namespace Cnet_Forum
{
    public partial class SearchForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string db = ConfigurationManager.ConnectionStrings["db"].ConnectionString;
            CandidateDataSource datasource = new CandidateDataSource(db);
            FunctionGroupDataSet functionset = datasource.GetFunctionGroup();
            datasource.Dispose();

            LoadSubjectGrid(functionset);
        }


        protected void LoadSubjectGrid(FunctionGroupDataSet functionset)
        {
            DataRow[] results;


            var view = area_tree_view;
            RadTreeNode groupNode, functionNode;

            foreach (var grouprow in functionset.FunctionGroup) // the parent node
            {
                results = functionset.Function.Select("parentNodeId = " + grouprow.function_group_id);

                groupNode = new RadTreeNode(grouprow.function_group_name, grouprow.function_group_id.ToString())
                {
                    Expanded = false,
                    Checkable = true
                };

                view.Nodes.Add(groupNode);

                foreach (DataRow functionRow in results) //the chile nodes
                {
                    functionNode = new RadTreeNode((string)functionRow["childNodeName"], Convert.ToString(functionRow["childNodeId"]));
                    groupNode.Nodes.Add(functionNode);
                }
            }
        }
    }
}

Obviously you can't run it because it requires db connection but you get the idea.

 

2 Answers, 1 is accepted

Sort by
0
scott
Top achievements
Rank 1
answered on 01 Oct 2015, 02:48 AM
This is what I see when running it.  I was expecting the +/- and the checkboxes but neither are there.  I'm using version 2011.2.712.35 and given the time constraint, I can't upgrade to the latest version.
0
Dimitar Terziev
Telerik team
answered on 05 Oct 2015, 07:15 AM
Hello,

As it appears from the provided screenshot the stylesheets are not loaded, thus the control has no styling. In order to troubleshoot this problem, please log your traffic using Fiddler and attach the log file in the support ticket which you have submitted for the same problem.

Regards,
Dimitar Terziev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
TreeView
Asked by
scott
Top achievements
Rank 1
Answers by
scott
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Share this question
or