Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
104 views
Hi,

When I use my own TreeView which is inherited from RadTreeView, it doesn't work like the base class and throw exception. 
My version is 2013.1.403.40

First I create the new TreeView, very simple.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Web.UI;
 
namespace TreeViewTest
{
    public class XTreeView:RadTreeView
    {
    }
}

Then I drag it to a aspx page. on the code behind. I write code like this.
                string xmlStr = @"<Tree>
  <Node Text='Desktop' Expanded='True' ToolTip='Desktop' ImageUrl='~/TreeView/Img/Vista/desktop.png'>
    <Node Text='Administrator' ImageUrl='~/TreeView/Img/Vista/folder-personal.png' Expanded='True'>
      <Node Text='AppData' ImageUrl='~/TreeView/Img/Vista/folder.png'>
        <Node Text='Microsoft'  ImageUrl='~/TreeView/Img/Vista/folder.png'/>
      </Node>
      <Node Text='Contacts' ImageUrl='~/TreeView/Img/Vista/folder-contacts.png' />
      <Node Text='Downloads'  ImageUrl='~/TreeView/Img/Vista/folder-open.png'/>
      <Node Text='Documents' ImageUrl='~/TreeView/Img/Vista/folder-documents.png' Selected='True' />
      <Node Text='Favorites' ImageUrl='~/TreeView/Img/Vista/folder-favorites.png' >
        <Node Text='Links'  ImageUrl='~/TreeView/Img/Vista/folder.png'/>
      </Node>
      <Node Text='Music' ImageUrl='~/TreeView/Img/Vista/folder-music.png' />
      <Node Text='Pictures' ImageUrl='~/TreeView/Img/Vista/folder-pictures.png' />
      <Node Text='Saved Games' ImageUrl='~/TreeView/Img/Vista/folder-open.png'  />
      <Node Text='Searches' ImageUrl='~/TreeView/Img/Vista/searches.png'  >
        <Node Text='History'  ImageUrl='~/TreeView/Img/Vista/folder.png'/>
      </Node>
      <Node Text='Videos' ImageUrl='~/TreeView/Img/Vista/folder-videos.png' />
    </Node>
    <Node Text='Computer' ToolTip='My Computer'  ImageUrl='~/TreeView/Img/Vista/computer.png' Expanded='True' >
      <Node Text='WebServer (\\10.0.0.80) (W:)' ImageUrl='~/TreeView/Img/Vista/network-drive.png' />
      <Node Text='Local Disk (C:)' ImageUrl='~/TreeView/Img/Vista/system-drive.png' Expanded='True' >
        <Node Text='inetpub'  ImageUrl='~/TreeView/Img/Vista/folder.png' Expanded='True'>
          <Node Text='AdminScripts'  ImageUrl='~/TreeView/Img/Vista/folder.png'></Node>
        </Node>
      </Node>
    </Node>
  </Node>
</Tree>";
                XTreeView1.LoadXmlString(xmlStr);

Just xml string and LoadXmlString. It gives me error.  The same code works well with base RadTreeView.

Could you please take a look at it?

Thank you very much.

Bill
wg
Top achievements
Rank 1
 answered on 05 Jun 2013
2 answers
144 views
Hi,

I have a dynamic treeview which is created in page_load. and I want to make it load on demand. here is my code.
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Linq;
 
namespace TreeViewTest
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RadTreeView treeView = new RadTreeView();
 
            if (!IsPostBack)
            {
                var treeViewDataList = GetDB().Where(c => c.ParentId == null);
                foreach (var treeviewItem in treeViewDataList)
                {
                    RadTreeNode node = new RadTreeNode();
                    node.Text = treeviewItem.Name;
                    node.Value = treeviewItem.Id.ToString();
                    node.ExpandMode = TreeNodeExpandMode.ServerSide;
                    treeView.Nodes.Add(node);
                }
            }
            treeView.NodeExpand += (s, arg) =>
            {
                if (arg.Node.Nodes.Count == 0)
                {
                    //string pId = "-1";
                    var treeViewDataList = GetDB().Where(c => c.ParentId.ToString() == arg.Node.Value);
                    foreach (var treeviewItem in treeViewDataList)
                    {
                        RadTreeNode node = new RadTreeNode();
                        node.Text = treeviewItem.Name;
                        node.Value = treeviewItem.Id.ToString();
                        node.ExpandMode = TreeNodeExpandMode.ServerSide;
                        arg.Node.Nodes.Add(node);
                    }
                    arg.Node.Expanded = true;
                }
            };
 
            this.form1.Controls.Add(treeView);
        }
 
        public List<TreeViewItem> GetDB()
        {
            List<TreeViewItem> list = new List<TreeViewItem>();
          
            list.Add(new TreeViewItem { Id=1, Name="A", ParentId=null });
            list.Add(new TreeViewItem { Id = 2, Name = "B", ParentId = null });
            list.Add(new TreeViewItem { Id = 3, Name = "C", ParentId = null });
 
            list.Add(new TreeViewItem { Id = 4, Name = "A-01", ParentId = 1 });
            list.Add(new TreeViewItem { Id = 5, Name = "A-02", ParentId = 1 });
 
            list.Add(new TreeViewItem { Id = 6, Name = "B-01", ParentId = 2 });
        
            return list;
        }
    }
 
 
    public class TreeViewItem
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public int? ParentId { get; set; }
    }
}

And here is aspx code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TreeViewTest._Default" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
     
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
    <div>
     
    </div>
    </form>
</body>
</html>

but after click the node to expand it, it gives empty nodes like attached image.

Could you please take a look at it?

Thank you very much.

Bill
wg
Top achievements
Rank 1
 answered on 05 Jun 2013
1 answer
98 views
Greetings,
I would request help from on the below scenario

I have a pivot Rad Pivot Grid wherein i have one "PivotGridColumnField" which would populate as many columns based on the values. As per the attached screenshot (Screen.png), the values rendered as "David", "Janet" & "Sam". My requirement is to have different aggregate functions in each columns ("David", "Janet" & "Sam"). E.g. Sum in "David", Min in "Janet" & Max in "Sam".

Thanks in advance for your Quick Support

Regards
Prakash (for Karthick)
Tsvetoslav
Telerik team
 answered on 05 Jun 2013
1 answer
62 views
I inherited a web site with a number of update panels
I added a RadWindow not in any of the update panels but containing an update panel
the page adds one or more user controls to the page as part of the initial page load
opening the radwindow removes these

I got around it with a kluge in the page load
If Me.IsPostBack Then
    If rwLumpSum.Visible Then ' postback from opening the RadWindow
        ws = New CommonFunctions("Orders")
        BuildStoresfromChain(ws)
    End If
    GoTo Attributes
End If

is there a better way?
Danail Vasilev
Telerik team
 answered on 05 Jun 2013
3 answers
97 views
HI there,

My problem is this, i have a radmenu being created by the database, but i need to put globalisations for translation of the menu.

what can i use to do it knowing i already have resource files for the rest of the page.

BestRegards
Kate
Telerik team
 answered on 05 Jun 2013
1 answer
117 views
I had this working at one point, and then I added recurrence, using a GUID as my primary key. This all works fine. However, when hovering over the appointment, the tooltip no longer works. If you look at the code below, the 'apt' has 'nothing' in it. The e.Value has the string of the GUID. It appears as if the FindByID is not working with the GUID.

Thanks,
Susan

Dim aptId As Integer

Dim apt As Telerik.Web.UI.Appointment

If Not Integer.TryParse(e.Value, aptId) Then

'The appoitnment is occurrence and FindByID expects a string

apt = RadScheduler1.Appointments.FindByID(e.Value)

Else

'The appointment is not occurrence and FindByID expects an int

apt = RadScheduler1.Appointments.FindByID(aptId)

End If

Dim toolTip As CalendarToolTip = CType(LoadControl("~/CalendarToolTip.ascx"), CalendarToolTip)

toolTip.TargetAppointment = apt

e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip)

Plamen
Telerik team
 answered on 05 Jun 2013
4 answers
368 views

User Story (see attached image)

A user clicks the upper grid which is a list of books.  When they select a book from the upper grid, a lower grid will appear which will allow them to select which campuses will receive this book. 

Actions:

A user will enter a quantity (radNumericTextbox) in a textbox and then hit the tab or enter key and will be moved to the next textbox.  On the client side OnBlur event, a webmethod is called to save the value the user just entered.  At this time a couple of things will happen.  I am using the jquery blockUI tool to block the UI incase the network is slow, once the jquery ajax call is “complete” the blockUI is dismissed.  The upper grid will add a check mark to indicate the book is part of this order now and the lower grid will now display a DELETE icon.   The focus is moved to the next textbox waiting for input from the user...

Notes:

I am looking for an example that is similar to this.  My grid is NOT in edit mode and our product manager does not want the user to have to hit EDIT or SAVE icons…  They are also interested in perhaps having the user enter a ZERO to actually perform a delete, which would allow us to remove the delete icon.

All in all, you enter a value, it saves and give you a visual indicator that it saved.  Replacing a number in a textbox with a Zero value will delete an item that was already on the order…

Does anyone know of any radgrid examples similar to this?

Wired_Nerve
Top achievements
Rank 2
 answered on 05 Jun 2013
3 answers
170 views
I've been trying everything I can think of to get this working...

Basically I've got a web page which loads user controls dynamically.

On the user controls, I'm using the radAjaxManagerProxy successfully.  However, when I create a radWindow from one of them, I cannot find a way to create the Ajax event on the containing page which will load the radAjaxLoadingPanel to cover all of the items on the containing page.  So the radWindow is not truly modal; I can still click on radMenu items above the user controls.

I thought about putting the radWindow in the containing page, but I don't want the user controls to have to be aware of its presence should things change.

Any help would be greatly appreciated.  I've gone through a ton of samples, but couldn't find anything that really fit my scenario.

Thanks!
Viktor Tachev
Telerik team
 answered on 05 Jun 2013
1 answer
81 views

I have RadTabStrip and  RadMultiPage  inside HTML table , the issue found only on Safari browser , the table vertical scroll bar move up and down without moving the page that associated with.

Please advise.

Kate
Telerik team
 answered on 05 Jun 2013
1 answer
74 views
I have a radorgchart within a radajaxpanel in a parent tab1/pageview1.  In another tab2/pageview2, child tabs update controls on pageview2.  However, when these controls ajax-update, the radorgchart collapses horizontally (not group collapsing, just the width of the chart).  Dragging one of the nodes or selecting a node data edit field (all-ajaxified) magically re-expands the radorgchart.  I'm thinking this is an ajax update associated controls issue, but I haven't been able to correct it.  Any suggestions?
Peter Filipov
Telerik team
 answered on 05 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?