Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
840 views
I've seen one or two recent posts on this error, but no resolution.

I am using 2009 Q1 controls. Here is how I generate this error on my system here at work. I create a new Ajax-enabled web application. I make sure that the folder holding the site is designated as an application. I drag RadAjaxManager into the default page. I compile and bring up the page (on localhost) -- the javascript error "sys.webforms.pagerequestmanager is null or not an object" appears. (In more complex solutions, I have seen that this error prevents functioning of components like RadEditor.) It is entirely related to RadAjaxManager.

Now, I should mention that my computer at home, running the same application, does not have this error. So there is clearly something relating to my installation causing this, but it seems to be bothering other people as well. I have not been able to identify what the issue could be, it isn't anything obvious. What it means is that I do not have a way to develop Ajax-enabled sites using Telerik controls while at work. Which is not good.
Sebastian
Telerik team
 answered on 15 Jun 2009
0 answers
178 views

Hi,

We downloaded the evaluation version of RadControls for ASP.Net and are using the RadTreeView. We are planning to purchase the full version soon, but we ran into a strange issue with the RadTreeView control.

Our TreeView control needs each node to be template as a Table. But each level of the tree needs a different template, so not one single template for the whole tree. Also, all nodes are created dynamically at runtime, and the SingleExpandPath property is set to true.

Now we experience the following issue:

When we select the second node below a templated node, the nodeValue we get at serverside is the value of the first node!

I was able to reproduce this with a simpler version of the code we use for real, when you run the code below, you can expand the tree until the second level, and then, when you select the “child2ofchild1” node, the code behind will tell you that “child1ofchild1” nodes was selected. Could you guys look into this and tell us what we are doing wrong?

 

The asp.net code:

 

<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" ChildrenAsTriggers="true" runat="server">
<ContentTemplate>
 <telerik:RadTreeView ID="RadTreeView1" Runat="server" SingleExpandPath="true"
  OnNodeExpand="TreeView_NodeExpand" OnNodeCollapse="TreeView_NodeCollapse"
  OnNodeClick="TreeView_NodeClick">
 </telerik:RadTreeView>
</ContentTemplate>
</asp:UpdatePanel>

 

 

 

 

The codebehind:
 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        #region Node Template
        class TableTemplate : ITemplate
        {
            private string m_cell1Text;
            private string m_cell2Text;
            private int m_cell1Size;
            private int m_cell2Size;

            public TableTemplate(string cell1Text, string cell2Text,
                int cell1Size, int cell2Size)
            {
                m_cell1Text = cell1Text;
                m_cell2Text = cell2Text;
                m_cell1Size = cell1Size;
                m_cell2Size = cell2Size;
            }

            public void InstantiateIn(Control container)
            {
                Table nodeTable = new Table();
                TableRow nodeRow = new TableRow();

                TableCell firstCell = new TableCell();
                firstCell.Style["width"] = m_cell1Size + "px";
                firstCell.DataBinding += new EventHandler(firstCell_DataBinding);
                nodeRow.Cells.Add(firstCell);

                TableCell secondCell = new TableCell();
                secondCell.Style["width"] = m_cell2Size + "px";
                secondCell.DataBinding += new EventHandler(secondCell_DataBinding);
                nodeRow.Cells.Add(secondCell);

                nodeTable.Rows.Add(nodeRow);
                container.Controls.Add(nodeTable);
            }

            private void firstCell_DataBinding(object sender, EventArgs e)
            {
                TableCell target = (TableCell)sender;
                target.Text = m_cell1Text;
            }

            private void secondCell_DataBinding(object sender, EventArgs e)
            {
                TableCell target = (TableCell)sender;
                target.Text = m_cell2Text;
            }
        }
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //first time, load root node
                LoadTreeRoot();
            }
        }

        private void LoadTreeRoot()
        {
            RadTreeView1.Nodes.Add(
                new RadTreeNode
                    {
                        Value = "root",
                        Text = "root",
                        ExpandMode = TreeNodeExpandMode.ServerSide
                    });
        }

        #region TreeView Events
        public void TreeView_NodeExpand(object sender, RadTreeNodeEventArgs e)
        {
            //get the value of the node that is expanded
            string expandedNodeValue = e.Node.Value;
          
            //refresh the tree, with this node selected
            RefreshTree(expandedNodeValue, true);

            //set this node as selected
            SetNodeSelected(expandedNodeValue);
        }

        public void TreeView_NodeCollapse(object sender, RadTreeNodeEventArgs e)
        {
            //get the value of the node that is collapsed
            string collapsedNodeValue = e.Node.Value;
          
            //refresh the tree, with this node selected
            RefreshTree(collapsedNodeValue, false);

            //set this node as selected
            SetNodeSelected(collapsedNodeValue);
        }

        public void TreeView_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            //get the value of the clicked node
            string clickedNodeValue = e.Node.Value;

            //refresh the tree
            RefreshTree(clickedNodeValue, false);

            //set this node as selected
            SetNodeSelected(clickedNodeValue);
        }
        #endregion

        #region TreeView Refresh
        private void RefreshTree(string targetNodeValue, bool expanded)
        {
            //find the root node
            RadTreeNode rootNode = RadTreeView1.FindNodeByValue("root");

            if (rootNode != null)
            {
                //clear the nodes
                rootNode.Nodes.Clear();

                //refresh the nodes below this root
                //child nodes
                RadTreeNode child1 = new RadTreeNode { Value = "child1", ExpandMode = TreeNodeExpandMode.ServerSide };
                TableTemplate child1Template = new TableTemplate("child1Cell1", "child1Cell2", 200, 100);
                child1Template.InstantiateIn(child1);
                rootNode.Nodes.Add(child1);

                if ((targetNodeValue != "root" && targetNodeValue != "child1") ||
                    (targetNodeValue == "child1" && expanded))
                {
                    //also expand this child node
                    child1.Expanded = true;

                    //add the childofchild nodes
                    //first
                    RadTreeNode child1ofchild1 = new RadTreeNode { Value = "child1ofchild1" };
                    TableTemplate child1ofchild1Template = new TableTemplate("child1ofchild1Cell1", "child1ofchild1Cell2", 180, 100);
                    child1ofchild1Template.InstantiateIn(child1ofchild1);
                    child1.Nodes.Add(child1ofchild1);

                    //second
                    RadTreeNode child2ofchild1 = new RadTreeNode { Value = "child2ofchild1" };
                    TableTemplate child2ofchild1Template = new TableTemplate("child2ofchild1Cell1", "child2ofchild1Cell2", 180, 100);
                    child2ofchild1Template.InstantiateIn(child2ofchild1);
                    child1.Nodes.Add(child2ofchild1);
                }
            }

            //databind
            RadTreeView1.DataBind();
        }

        private void SetNodeSelected(string selectedNodeValue)
        {
            RadTreeNode selectedNode = RadTreeView1.FindNodeByValue(selectedNodeValue);

            if (selectedNode != null)
            {
                selectedNode.Selected = true;
            }
        }
        #endregion
    }
}

Kristof
Top achievements
Rank 1
 asked on 15 Jun 2009
1 answer
114 views
I want to get new values from a database every 30 seconds. I've setup an ajax panel and put a timer in it. It fires every 30 seconds and updates labels on my aspx page.

Now i want to move images on the page based on the new database values. I aim to do this using DIV tags and by setting the left and top properties. For this i need the values from the server side.

How do i send values from the server to client?

Kind regards
Andrew
Veli
Telerik team
 answered on 15 Jun 2009
4 answers
162 views
Hi,  I have seen accordians like this that fully expand (and therefore show all child options) if javascript is disabled on pageload.

e.g. http://www.projectseven.com/viewer/index.asp?demo=apm

Is this possible or is there a workaround with the telerik panelbar? I have someone asking if this can be done...

Thanks,
Matt
Atanas Korchev
Telerik team
 answered on 15 Jun 2009
1 answer
142 views
I have a rad panel inside a master page. Its EnableEmbeddedSkins & EnableEmbeddedBaseStylesheet is set to false. It works fine.
But I have one content page which has another rad panel. Its skin is set. When this content page is called the skin of the rad panel inside the master is also changed.
plz help.
kollam2003
Top achievements
Rank 1
 answered on 15 Jun 2009
2 answers
126 views
I am trying to find some documentation on the RadInputManager's validation capabilities. I can get the textboxs to validate but DatePicker is being ignored.

Also, there is no explanation anywhere what Validation-Location or Validation-Method means.
Stuart Hemming
Top achievements
Rank 2
 answered on 15 Jun 2009
1 answer
119 views
Hi all,

A small question!
Is there any property or function available so that i could set min and max date range for scheduler. In fact i want to restrict user not to select date less then the current date from scheduler calendar. Kindly help me out.

Regards
Faiq Shah
Shinu
Top achievements
Rank 2
 answered on 15 Jun 2009
1 answer
140 views
Hello Telerik Team  ,

Is there a way to call RadCalendar1_DefaultViewChanged on external Button  click  Server event .  I am not able to pass the parameters correctly.
Any Help will be Appreciated .

Thank You
Vipin
Shinu
Top achievements
Rank 2
 answered on 15 Jun 2009
1 answer
144 views
WIBNI you could set the OrderIndex property of columns in, say the ColumnCreated event handler and just automagically have the grid render them in that order.

It would also be nice if you could set the Orderindex property of just some of the columns and know that they would appear in the order described and the rest of the columns would appear to the right of there.

--
Stuart
Yavor
Telerik team
 answered on 15 Jun 2009
1 answer
237 views
Hi,

We've been using RadGrid for a few years now but have never been able to adequately solve a very basic problem: we'd like to merge several adjacent columns in such a way that preserves their sorting. This *must* be done dynamically at run-time (design time is not an option).

Ideally, the resulting table header should have a single merged cell above the individual columns with some descriptive text in it, while the individual columns (and sorting features) sit below it:

-------------------
| Group Name |
-------------------
|     |      |     |    |
-------------------

We can kind of get close to this by trapping the DataGrid_ItemCreated event, hiding all but the first column header, and then replacing its contents with a custom HTML table. This does not allow us to sort the columns however.

Is there some mechanism available by which we can group columns?
Princy
Top achievements
Rank 2
 answered on 15 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?