Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
73 views
Hello,

Below is my Code. I am triggering lblerrormessage from Code behind, if there is any error. If not I am not showing that and redirecting the page.

It is throwing me Ajax error, if there is no error in page while redirecting. I think it is looking to update lblerrormessage everytime. What I have to do ?

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnReject1">
                <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="lblErrorMessage" />
                                   
                </UpdatedControls>
            </telerik:AjaxSetting>
         </AjaxSettings>
       </telerik:RadAjaxManager>
Kostadin
Telerik team
 answered on 30 Jul 2012
1 answer
88 views
Hi

I am having treeView where parent/First node is User Control. It is for user to type item name and click on search button. On Click on search button treeView gets loaded with valid items. It looks like

- User Control (text box + Button)
   - Item1
   - Item 2
   + Item 3
   - Item 4

When user is clicking any of the node, like Item 1 or Item 2, User control is disappearing from the treeView. I can only see other node. It is happening only when I am clicking node, if I am trying to expand the node it is maintaining user control as it is.

Please kindly guide me on how to solve this problem.

Thanks,
Pradip
Plamen
Telerik team
 answered on 30 Jul 2012
3 answers
374 views
I have a RadTreeView on the click the nodes get selected and then at the right click a context menu is shown. This is working fine but the problem is to a context menu for a node I have to first select it and then right click on it. Is there a way by which directly on the right click the node will be selected and the context menu will appear for it.
Peter
Telerik team
 answered on 30 Jul 2012
1 answer
114 views
I have a PanelBar that is getting populated client-side via JS.  Below is a code example:

var panel = $find('RadPanelBar');
var rootItem = panel.findItemByText("RootItem");
for (var i = 0; i < array.length; i++) {
    var item = new Telerik.Web.UI.RadPanelItem();
    item.set_text(array[i].someText);
    panel.trackChanges();
    rootItem.get_items().add(item);
    panel.commitChanges(); 
}

This seems to serve it's purpose, I can inspect the root item after the loop and can see all the added child items.  

The problem is when I click on this RadPanelBar root item, nothing happens.  The "expand/collapse" icon switches on click and any expand/collapse/click events are fired as normal, just no child Items are shown.  I have tried almost everything.

Even when adding the RadPanelItems statically at design time, I see the same problem.  
<telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="100%" Height="600px">
    <Items>
        <telerik:RadPanelItem runat="server" Text="TestRoot" Expanded="True">
            <Items>
                <telerik:RadPanelItem Text="TestChild">
                </telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelItem>
    </Items>      
</telerik:RadPanelBar>

This also has the same outcome, can't expand to see the child item.

Any ideas?  Am I missing something?
Kate
Telerik team
 answered on 30 Jul 2012
2 answers
514 views
Having some problems with the javascript to get all nodes using the sample code provided here:

http://www.telerik.com/help/aspnet-ajax/treeview-client-objects-radtreenode.html

Am getting the error

Error: TypeError: tree is null
Source File: http://localhost/Edit/CategorySelection.aspx
Line: 48

I thought jQuery might be causing some problems, it is in no conflict mode. have tried changing
var tree = $find("<%= RadTreeView1.ClientID %>");
to
var tree = jQuery("<%= RadTreeView1.ClientID %>");
but i get the error

Error: TypeError: tree.get_nodes is not a function
Source File: http://localhost/Edit/CategorySelection.aspx
Line: 48

Any idea whats causing this error? (code below, js to get nodes contained in nodetest and loaded on document load

Master Page:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Main1.master.cs" Inherits="Main1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head runat="server">
    <title></title>
    <link rel="stylesheet" href="~/css/style.css" />
    <script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">jQuery.noConflict();</script>
    <asp:ContentPlaceHolder id="ContentHead" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <div id="wrapper">
        <form id="form1" runat="server">
            <asp:Literal ID="test1" runat="server"></asp:Literal>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
            <div class="headercon">
                <asp:Panel id="header" CssClass="header" runat="server">
                    <asp:HyperLink ID="HyperLink1" NavigateUrl="~/?reset=global" runat="server">
                        <div class="logo">                       
                        </div>
                    </asp:HyperLink>
                    <div class="fascia"></div>
                    <div class="topmenu">
                        <ul>
                            <li class="on"><asp:HyperLink ID="HyperLink2" NavigateUrl="~/" runat="server">Dashboard</asp:HyperLink></li>
 
                            <li class="list">
                                <asp:Label ID="LabelFascia" runat="server" AssociatedControlID="FasciaDropDown" Text="Fascia" />
                                <telerik:RadComboBox ID="FasciaDropDown" runat="server" Width="140px" AutoPostBack="True" OnSelectedIndexChanged="Fascia_SelectedIndexChanged" />
                            </li>
 
                            <li><asp:HyperLink ID="HyperLink3" NavigateUrl="~/Edit/Default.aspx" runat="server">Style</asp:HyperLink></li>
                            <li><asp:HyperLink ID="HyperLink4" NavigateUrl="~/Reports/Default.aspx" runat="server">Reports</asp:HyperLink></li>
                            <li><asp:HyperLink ID="HyperLink5" NavigateUrl="~/Admin/Default.aspx" runat="server">Admin</asp:HyperLink></li>
                        </ul>
                    </div>
                </asp:Panel>
            </div>
            <div class="content">
                <asp:Panel id="breadcrumbs" runat="server"></asp:Panel>
                <asp:ContentPlaceHolder id="ContentMain" runat="server">
                </asp:ContentPlaceHolder>
            </div>
            <div class="footer">
            </div>
        </form>
    </div>
</body>
</html>

Page

<%@ Page Title="" Language="C#" MasterPageFile="~/Main1.master" AutoEventWireup="true" CodeFile="CategorySelection.aspx.cs" Inherits="CategoryEditor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentHead" Runat="Server">
    <script type="text/javascript">
        //<!--
        function nodeDropping(sender, args) {
            // set target to the element on which the node is dropped
            var target = args.get_htmlElement();
            // check whether target is in the panel or tree view
            // by working up the parent chain to a known element
            try {
                while (target) {
 
                    var targetID = target.id;
                    var className = target.className;
                    // we reached the tree view -- this is a good target                 
                    if (targetID == "<%# RadTreeView1.ClientID %>")
                        return;
                    // the "between nodes" lines are not actually in the tree view,
                    // but they have class names that begin "rtDrop"
                    else if (className.startsWith("rtDrop"))
                        return;
                    // we are inside the panel -- this is a good target
                    else if (targetID == "<%# Panel1.ClientID %>") {
                        args.set_htmlElement(target);
                        return;
                    }
                    target = target.parentNode;
                }
            } catch (e) { }
            // we were not in a good target, cancel the drop
            args.set_cancel(true);
        }
 
        function nodeCheck(sender, args) {
            var target = args.get_selectedNodes();
 
        }
 
        function nodetest() {
            var tree = $find("<%= RadTreeView1.ClientID %>");
            var allNodes = tree.get_nodes().getNode(0).get_allNodes();
            for (var i = 0; i < allNodes.length; i++) {
                var node = allNodes[i];
                alert(node.get_text());
            }
 
        }
 
        jQuery(document).ready(function () {
            nodetest();
        });
 
        //-->
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentMain" Runat="Server">
    <h1>Category Editor</h1>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <asp:Label ID="treeSearchLabel" runat="server">Refine</asp:Label>
    <asp:TextBox ID="treeSearch" runat="server"></asp:TextBox>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
        <telerik:RadTreeView ID="RadTreeView1" runat="server"
            EnableDragAndDrop="true"
            OnNodeDrop="TreeView_NodeDrop"
            OnClientNodeDropping="nodeDropping"
 
            TriStateCheckBoxes="true"
            CheckBoxes="true"
            CheckChildNodes="false"
            >
            <Nodes>
            </Nodes>
        </telerik:RadTreeView>
    </telerik:RadAjaxPanel>
 
    <asp:Panel ID="Panel1" runat="server" ForeColor="#7799FF" BorderColor="#7799FF"
        BorderStyle="Double" BorderWidth="4px" GroupingText="Details" >
        <asp:Label ID="Label1" runat="server" ></asp:Label>
        <asp:Label ID="WhatsChecked" runat="server" ></asp:Label>
    </asp:Panel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTreeView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
</asp:Content>

Craig
Top achievements
Rank 1
 answered on 30 Jul 2012
1 answer
43 views
The following code iterates through all of the groupheaderitems in my RadGrid. I was originally having trouble expanding groups programmatically because I was attempting to expand based on sequential item.groupindex indexes, e.g. if (item.groupindex == "0" || item.groupindex == "1".

However, I found that the groupindex == "1" wasn't working so I wrote the following method to append all of the indexes to a stringbuilder:

protected void WeeklyGoalsGrid_PreRender(object sender, EventArgs e)
       {
           StringBuilder sb = new StringBuilder();
           foreach (GridGroupHeaderItem item in WeeklyGoalsGrid.MasterTableView.GetItems(GridItemType.GroupHeader))
           {
               sb.Append(item.GroupIndex);
           }           
       }

When I run the application, the stringbuilder contains {02468} and so on rather than what I thought should be {01234}

Does anyone know why the GroupHeaderItem indexes increase by two rather than by 1? This doesn't affect my code, as now I know what to look for, but I was just wondering about the reasoning behind this.

Thanks,

Josh
Andrey
Telerik team
 answered on 30 Jul 2012
3 answers
283 views
I am using a repeater within my RadListView which has the data source set like DataSource='<%# Bind("ContactDetails") %>'.

So then I can loop through the different properties of the ContactDetails and use them, but when I update any data in these fields the data is lost on post back.

I have read quite a lot of different blog posts etc and they seem to think I need to bind in the Onint method, but since I don't bind in the code behind, I have no idea how to do this, or if this will actually solve my problem.

The data source for the RadListView is calling a WCF web Service that expects JSON.

Here is an example of the code I am using....
Please ignore any small syntax errors, I have quickly shortend this code for putting on the forums.

<telerik:RadListView ID="RadListView1" runat="server" DataSourceID="ObjectDataSource1" Skin="Hay">
    <ItemTemplate>
        <asp:Repeater ID="ContactDetails" runat="server" DataSource='<%# Bind("ContactDetails") %>'>
            <ItemTemplate>
                <asp:Label ID="ContactDetailLabel" runat="server"
                    AssociatedControlID="ContactDetailTextBox"
                    Text='<%# Bind("ContactDetailType") %>'></asp:Label>
                <asp:TextBox ID="ContactDetailTextBox" runat="server" CssClass="rlvInput"
                    Text='<%# Bind("Value") %>' />
            </ItemTemplate>
        </asp:Repeater>                    
        <asp:Button ID="UpdateButton" runat="server" CommandName="Update"
            Text="Update Profile" ToolTip="Update" />
    </ItemTemplate>
</telerik:RadListView>

Any help would be great, I am totally stuck on this one. Is it even possible to do what I want?

Vasil
Telerik team
 answered on 30 Jul 2012
1 answer
83 views
Is there any ATM?

Thank you.
Vasil
Telerik team
 answered on 30 Jul 2012
5 answers
739 views
Hi All,

I am using hierarchical grid which shows categories and its details.
Now i want to show / hide columns which are in detail table depending on category.

as follows, C1, C2 are categories and A, B, C are columns...

-C1
    A  B  C
-C2
    A C

Please help me to solve my problem.

Thanks,
Amol Wable


Shinu
Top achievements
Rank 2
 answered on 30 Jul 2012
1 answer
42 views
We recently upgraded Telerik ASP.NET controls from version 2011 Q3 to version 2012 Q2.

In the main company project (Metro skin set) this resulted in the filter boxes within RadGrids to increase from 13 to 25 characters in width.
This effect is evident with the style sheet removed from the project.

How can the width of the filter boxes be reset to 13 characters please ?

Andrey
Telerik team
 answered on 30 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?