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

LoadingMessage not showing

2 Answers 53 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
FU
Top achievements
Rank 2
FU asked on 15 Feb 2010, 07:59 AM

I've tried adding a 'Loading'-message while the tree expands the childnodes, but the code below doesn't show any message. What am I missing?

Admin.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Admin.aspx.cs" Inherits="TestAdmin" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!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">
<head>
    <title>Test</title>
  </head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager id="ScriptManager1" runat="server" />
            <telerik:RadTreeView ID="RadTreeView1" OnNodeExpand="RadTreeView1_NodeExpand" LoadingMessage="Loading" LoadingStatusPosition="BelowNodeText" runat="Server" />
    </form>
</body>
</html>

 

Admin.aspx.cs:
using System;
using System.Web;

using Telerik.Web.UI;

public partial class TestAdmin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
   RadTreeNode root = new RadTreeNode("Root", "0");

   root.ExpandMode = TreeNodeExpandMode.ServerSide;

   RadTreeView1.Nodes.Add(root);
        }
    }

    protected void RadTreeView1_NodeExpand(object sender, RadTreeNodeEventArgs e)
    {
  RadTreeNode node;

  for (int i = 0; i < 1000; i++)
  {
   node = new RadTreeNode("New node " + i.ToString(), "New value");

   node.ExpandMode = TreeNodeExpandMode.ServerSide;

   e.Node.Nodes.Add(node);
  }
    }
}

Regards,
Claus Pedersen

2 Answers, 1 is accepted

Sort by
0
Accepted
Veronica
Telerik team
answered on 16 Feb 2010, 05:06 PM
Hello Mickey13,

Thanks for your question.

After an inspection of your code I noticed that the only thing you missed is the ExpandMode of the TreeViewNode.
In your case you set it to TreeNodeExpandMode.ServerSide. However this causes a postback from the server and you are not able to see any LoadingMessage.

protected void Page_Load(object sender, EventArgs e)
       {
           if (!Page.IsPostBack)
           {
               RadTreeNode root = new RadTreeNode("Root", "0");
               root.ExpandMode = TreeNodeExpandMode.ServerSide;
               RadTreeView1.Nodes.Add(root);
           }
       }


The correct one is TreeNodeExpandMode.ServerSideCallBack. This is the same as ServerSide, except that the tree view generates an AJAX callback rather than a postback. While waiting for the results of the callback, the string specified by the tree view's LoadingMessage property is displayed in the position specified by the LoadingStatusPosition property.

You may see the solution in the attached .zip file.

Please let me know if this was helpful.

Best wishes,
Veronica Milcheva
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
FU
Top achievements
Rank 2
answered on 17 Feb 2010, 07:37 AM
That worked. Thank you.
Tags
TreeView
Asked by
FU
Top achievements
Rank 2
Answers by
Veronica
Telerik team
FU
Top achievements
Rank 2
Share this question
or