Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
592 views
Hi,

Please help me with the following issue:
I want to disable the selection on parent node in this code below

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DisableNodeSelected.aspx.cs" Inherits="Portal.Demo.RadControls.RadTreeView.DisableNodeSelected" %> 
 
<!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 runat="server"> 
    <title></title> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
        <telerik:RadTreeView ID="RadTreeView1" runat="server"> 
            <Nodes> 
                <telerik:RadTreeNode Text="Parent 1" Value="Parent 1" Selected="true"> 
                    <Nodes> 
                        <telerik:RadTreeNode Text="Child 01" Value="Child 01" /> 
                        <telerik:RadTreeNode Text="Child 02" Value="Child 02" /> 
                        <telerik:RadTreeNode Text="Child 03" Value="Child 03" /> 
                        <telerik:RadTreeNode Text="Child 04" Value="Child 04" /> 
                        <telerik:RadTreeNode Text="Child 05" Value="Child 05" /> 
                    </Nodes> 
                </telerik:RadTreeNode> 
                <telerik:RadTreeNode Text="Parent 2" Value="Parent 2"> 
                    <Nodes> 
                        <telerik:RadTreeNode Text="Child 01" Value="Child 01" /> 
                        <telerik:RadTreeNode Text="Child 02" Value="Child 02" /> 
                        <telerik:RadTreeNode Text="Child 03" Value="Child 03" /> 
                        <telerik:RadTreeNode Text="Child 04" Value="Child 04" /> 
                        <telerik:RadTreeNode Text="Child 05" Value="Child 05" /> 
                    </Nodes> 
                </telerik:RadTreeNode> 
            </Nodes> 
        </telerik:RadTreeView> 
    </div> 
    </form> 
</body> 
</html> 
 


Nikolay Tsenkov
Telerik team
 answered on 01 Jun 2010
5 answers
78 views
Hello

By removing RadScriptManager from my web page and dragging it on my MasterPage, the items in the RadTabStrip disappeared.
I read this article http://www.telerik.com/help/aspnet-ajax/radscriptmanager.html but what I should do ???

Thanks

Best Regards
Peter
Telerik team
 answered on 01 Jun 2010
3 answers
184 views
I was wondering if the following is possible, either through ItemTemplates, or through pure CSS:

I want to style my top level items with a custom theme like Office 2010 [Office 2010 like theme]. I can override the background image:

DIV.RadPanelBar .rpRootGroup .rpSelected
{
    background: url("Images/static.png") no-repeat scroll right -304px transparent;
    background-color:transparent;
}

but we miss the left hand border. Obviously to get this, we need another another image (this is done with another <span> element that wraps the .rpSelected element), but in your model there is no element that we can apply the background image too.

Is there a way to do this at design time? I really don't want to have to pluck out each .rpSelected and wrap it with my own <span> at runtime with JQuery...
Greg
Top achievements
Rank 1
 answered on 01 Jun 2010
1 answer
115 views

Working in IE 8, mostly, but trying to write a portable solution for modern browsers.

I'm catching the 'Showing' client-side event of the RadContextMenu and trying to adjust it's coordinates. The clientX, clientY and x,y members of the DOM event cannot be assigned a new value. Visual Studio breaks with a "htmlfile: Member not found" error.

My goal is to get a RadContextMenu to show inside a RadEditor when the user clicks in it (under certain conditions, this is a requirement from management). So I capture the onclick event for the RadEditor's content area (radEditor.get_document().body;). I then call show(evt) on the context menu, where 'evt' is the event object corresponding to the click event.

Because the RadEditor's content is in an IFRAME, you have to adjust the position of the click event before the context menu displays. This is done in the "Showing" event. However, I cannot assign a value to the members .clientX and friends. It's as if javascript has temporarily forgotten about integer + and += operators.

Is it possible that these members have become readonly/const at some point?

window.onload = function() { 
    //details is the radeditor 
 
    setTimeout(function() { 
        var node = $find(details).get_document().body; 
        if (node.attachEvent) 
            node.attachEvent("onclick", reDetails_InsideClick); 
        else 
            node.addEventListener("click", reDetails_InsideClick, false); 
    }, 250); 
 
} 
 

function reDetails_InsideClick(e) { 
    e = e || event; 
 
    var btnContext = $find(toolbarBottom).findItemByValue("Context"); 
    if (btnContext.get_checked()) { //Trivial application logic. 
        var rcm = $find(atcmContext); //atcmContext is the context menu 
        if(!e.target) 
            e.target = e.srcElement; //For some reason e.target is undefined here 
        rcm.show(e); 
    } 
} 

function rcmAutoText_Showing(sender, args) { 
    var node = /*get the editor's IFRAME element*/ 
    var evt = args.get_domEvent(); 
 
    while (node) { 
        evt.offsetX += node.offsetLeft; //Crashes Here: 'Member not found.' 
        evt.offsetY += node.offsetTop; 
        node = node.offsetParent; 
    } 
    evt.clientY += sender.get_element().clientHeight; 
} 

Peter
Telerik team
 answered on 01 Jun 2010
3 answers
211 views
Hi,
I have a lable control on my page which is not getting updated on an ajax callback. I can't figure out what's missing.

I have a button (cmdSearch) on my page with fires a RadWindow dialog. On the calling page I have an onClientClose handler in the javascript.

In that handler I have the followng code:
function DoDialogClose(sender)  
{  
 
    if (!sender.argument)  
        return false;  
 
    var sEventArg = "Update a Label";  
    if (sEventArg != "") {  
      
        var ram = $find("ctl00_RadAjaxManager1");  
        ram.ajaxRequest(sEventArg);   
    }  
 
} 

It works great and the event handler on the server side gets called.
    Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs)  
        If e.Argument.Length > 0 Then  
             lblMyLabel.Text = "Some text" 
        End If  
 
    End Sub  
 

I have my RadAjaxManagerProxy set as follows:
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="cmdSearch">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="lblMyLabel" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
 

The problem is that the label is never updated when I return from the Ajax call.
What am I missing?
Thanks ... Ed
Martin
Telerik team
 answered on 01 Jun 2010
1 answer
119 views
Hi,
I am trying to use several RadDatepicker controls in a RadPanel using a shared RadCalendar.
The problem I am facing is that the calendar is popping up correctly, but I am unable to select a date from the calendar.
I am using custom styles for the controls.
Please help asap.

Thanks.
Martin
Telerik team
 answered on 01 Jun 2010
1 answer
192 views
Dear All,

I am using master page for my application to give consistent page layout. I am facing problem whenever i am clicking radpanel my whole page is loading and i am noticing some flickering also. I am using server side coding for radpanel and that radpanel filtering with RadTabStrip. So I want to load only content page on clicking radpanel.I am attaching screenshoot. I want a solution for that.Thankyou..

please i want loading only content page how to solve this . 


<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Default.master.cs" Inherits="TelerikComponentsWS.Default" %> 
 
<%@ 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 runat="server"> 
   <meta http-equiv="Page-Enter" content="blendTrans(Duration=0)" /> 
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0)" /> 
   
 
    <title></title> 
    <link rel="Stylesheet" href="css/styles.css" type="text/css" /> 
  
</head> 
<body> 
    <form id="form1" runat="server"> 
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server"> 
        </telerik:RadStyleSheetManager> 
    <telerik:RadScriptManager ID="scm" runat="server" > 
   <Scripts> 
                <asp:ScriptReference Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
                                     Name="MicrosoftAjax.js" 
                                     Path="http://ajax.microsoft.com/ajax/3.5/MicrosoftAjax.js" /> 
            </Scripts> 
    </telerik:RadScriptManager> 
    <div style="height: 100%;" id="splitterContainer"> 
         <telerik:RadAjaxManager ID="radAjMan" runat="server" UpdatePanelsRenderMode="Inline" 
           > 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="horMenu"> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="leftMenu" /> 
                        <telerik:AjaxUpdatedControl ControlID="horMenu" LoadingPanelID="logPan"/> 
                       
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                  
            </AjaxSettings>            
        </telerik:RadAjaxManager> 
         
         
        <telerik:radformdecorator id="RadFormDecorator2" DecoratedControls="all" runat="server" decorationzoneid="ZoneID2" 
            skin="Windows7" ControlsToSkip="Select"> 
        </telerik:radformdecorator> 
         <telerik:radformdecorator id="RadFormDecorator1" DecoratedControls="all" runat="server" decorationzoneid="ZoneID3" 
            skin="Windows7" ControlsToSkip="Select"> 
        </telerik:radformdecorator> 
       <%-- <telerik:RadWindowManager ID="radWin" runat="server"> 
            <Windows> 
                <telerik:RadWindow ID="defFacWnd" OffsetElementID='<%#lnk_def_facility.ClientID%>' 
                    OpenerElementID='<%#lnk_def_facility.ClientID%>' NavigateUrl="~/User/DefFacility.aspx" 
                    OnClientClose="onDefFacClose" runat="server"> 
                </telerik:RadWindow> 
            </Windows> 
        </telerik:RadWindowManager>--%> 
        <telerik:RadFormDecorator ID="rad_decorator" runat="server" DecoratedControls="all" ControlsToSkip="Select"> 
        </telerik:RadFormDecorator> 
        <telerik:RadSplitter ID="contentSplitter" runat="server" Height="100%" Width="100%" 
          VisibleDuringInit="false" OnClientLoaded="initSplitter"  ResizeWithBrowserWindow="true" LiveResize="false" 
                PanesBorderSize="0" ResizeMode="EndPane"> 
            <telerik:RadPane ID="navigationPane" runat="server" Width="190" > 
                <div style="margin: 5px;"> 
                 <br/> 
                    <asp:Image ID="Image2" runat="server" ImageUrl="~/img/company_logo.jpg" /> 
                     
                    
                    <br /> 
                  <%--  <asp:LinkButton ID="lnk_def_facility" runat="server"></asp:LinkButton>--%> 
                </div> 
                
                <telerik:RadPanelBar ID="leftMenu" runat="server" Width="180px"> 
                </telerik:RadPanelBar> 
                 
                 <br/> 
                 <br/> 
                  <br/> 
                  
                <div > 
                <asp:Button runat="server" ID="btn_logout" Text="Logout"  CausesValidation="false" />   
                </div> 
            </telerik:RadPane> 
            <telerik:RadSplitBar ID="splitter" runat="server" CollapseMode="Forward"  /> 
            <telerik:RadPane ID="contentPane" runat="server" MinWidth="400"> 
             
                <div style="margin: 5px;"> 
                  <div id="ZoneID4" style="right: auto"> 
                <fieldset width="100%" style="border-style: none; padding-right: inherit;"  align="right"> 
                    <asp:Image ID="Image1" runat="server"  
                        ImageUrl="~/img/studentdatasuite_header.jpg" />  
                    </fieldset> 
                    </div> 
                   
                    <telerik:RadTabStrip ID="horMenu" runat="server" SelectedIndex="0" DataFieldID="module_id"> 
                        <DataBindings> 
                            <telerik:RadTabBinding TextField="module" ValueField="module_id" /> 
                        </DataBindings> 
                    </telerik:RadTabStrip> 
                   
                    
                </div> 
                <div style="margin: 5px;"> 
                 <asp:Panel ID="Panel1" runat="server"> 
                    <h2> 
                        <asp:Literal runat="server" ID="ltTitle"></asp:Literal></h2> 
                    <asp:ContentPlaceHolder ID="centerContent" runat="server"> 
                     
                    </asp:ContentPlaceHolder> 
                     </asp:Panel> 
                </div> 
                <div id="ZoneID3" style="right: auto"> 
                <fieldset width="100%" style="border-style: none; padding-right: inherit;"  align="center"> 
                    <p> Â© 2009 Sama IT Group. All rights reserved. 
                            <a target="_self" title="Home" href="http://www.samaitgroup.com/">Home</a>  
                            <a target="_self" title="Products" href="http://www.samaitgroup.com/products.html">Products</a>  
                            <a target="_self" title="Aboutus" href="http://www.samaitgroup.com/aboutus.html">Aboutus</a> 
                            <a target="_self" title="Support" href="http://www.samaitgroup.com/support.html">Support</a> 
                            <a target="_self" title="Contacts" href="http://www.samaitgroup.com/contactus.html">Contacts</a> 
                            <asp:Label runat ="server" ID= "lblLabel"></asp:Label> 
                       </p> 
                    </fieldset> 
                    </div> 
                 
            </telerik:RadPane> 
        </telerik:RadSplitter> 
       
        <telerik:RadAjaxLoadingPanel ID="logPan" runat="server" IsSticky="true" Transparency="30" 
            Style="position: absolute; top: 0; left: 0; line-height: 60px; text-align: center; 
            z-index: 99;" Width="100%" Height="100%" BackColor="#B9CDF7"> 
            <%--<asp:Image ID="img" runat="server" Width="130px" Height="60px" ImageUrl="~/img/loading.gif" 
                Style="border: 0; margin-top: 70px;"></asp:Image>--%> 
        </telerik:RadAjaxLoadingPanel> 
      
                     
                     
                 
    </div> 
<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1"> 
    <script type="text/javascript"> 
//        function onDefFacClose(oWnd) {            //get the transferred arguments 
//            var arg = oWnd.argument; 
//            if (arg) { 
//                var facName = arg.facName; 
//                $get(oWnd.get_openerElementID()).innerHTML = facName; 
//            } 
//        } 
        function initSplitter(sender, args)   
        {          
            sender.get_element().style.visibility = 'inherit';   
        }   
  
    </script> 
    
</telerik:RadScriptBlock> 
    </form> 
</body> 
</html> 
 
using System; 
using System.Linq; 
using Telerik.Web.UI; 
using TelerikComponentsWS.Common; 
using TelerikComponentsBL; 
using System.Web.UI; 
using System.Configuration; 
namespace TelerikComponentsWS 
{ 
    public partial class Default : System.Web.UI.MasterPage 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if(!IsPostBack) 
            { 
                navigationPane.Collapsed = !Membershipment.IsUserLogged; 
                if (!Membershipment.IsUserLogged) 
                { 
                    //btn_logout.Visible = false; 
                } 
                RebindTabs(); 
                
            } 
            horMenu.TabClick += new Telerik.Web.UI.RadTabStripEventHandler(horMenu_TabClick); 
            //btn_logout.Click += new EventHandler(btn_logout_Click); 
 
            string display = ConfigurationManager.AppSettings["Display"].ToString(); 
            if (display == "1") 
            { 
                //lblLabel.Visible = true; 
 
            } 
            else 
            { 
                //lblLabel.Visible = false; 
               
            } 
        } 
        
       void btn_logout_Click(object sender, EventArgs e) 
        { 
            Membershipment.SignOut(); 
            Response.Redirect(CommonMethods.ResolveUrl("Login.aspx")); 
        } 
        void horMenu_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e) 
        { 
            OnModuleChanged(e.Tab.Value.GetInteger()); 
        } 
        private void RebindTabs() 
        { 
            int? module = null; 
            if (LogonDetails.Instance.MenusSet != null) 
            { 
                var modules = LogonDetails.Instance.MenusSet.Modules; 
                horMenu.DataSource = modules; 
                if (modules.Count() > 0) 
                { 
                    module = modules[0].module_id; 
                } 
            } 
            else 
            { 
                horMenu.DataSource = null; 
            } 
          
                horMenu.DataBind(); 
            
            if (LogonDetails.Instance.MenusSet != null) 
            { 
                if (Page is Screen) 
                { 
                    var screen = LogonDetails.Instance.MenusSet.MenuItems.FirstOrDefault(mi => mi.screen_id == (Page as Screen).ScreenId); 
                    if (screen != null) 
                    { 
                        module = screen.module_id; 
                        SelectModule(module); 
 
 
                        SetupTitle(screen.screen); 
                    } 
                } 
            } 
 
            OnModuleChanged(module); 
            if (Page is Screen) 
            { 
                SelectScreen((Page as Screen).ScreenId); 
            } 
        } 
 
        private void SetupTitle(string title) 
        { 
            ltTitle.Text = title; 
            Page.Title = title; 
        } 
 
        private void SelectScreen(int screenID) 
        { 
            foreach (RadPanelItem groupPanel in leftMenu.Items) 
            { 
                foreach (RadPanelItem screenItem in groupPanel.Items) 
                { 
                    if (screenItem.Value.GetInteger() == screenID) 
                    { 
                        groupPanel.Expanded = true; 
                        return; 
                    } 
                } 
            } 
        } 
 
        private void SelectModule(int? module) 
        { 
            if (module.HasValue) 
            { 
                var tab = horMenu.Tabs.Where(t => t.Value == module.Value.ToString()).FirstOrDefault(); 
                if (tab != null) 
                { 
                    if (!tab.Selected) 
                    { 
                        tab.Selected = true; 
                        OnModuleChanged(module); 
                    } 
                } 
                
            } 
        } 
 
 
 
        private void OnModuleChanged(int? module) 
        { 
            if (module.HasValue) 
            { 
                leftMenu.Items.Clear(); 
                if (LogonDetails.Instance.MenusSet != null) 
                { 
                    var items = LogonDetails.Instance.MenusSet.ModuleMenuItems(module.Value).OrderBy(item => item.link_group_sequence); 
                    var groups = items.GroupBy(item => item.link_group); 
                    foreach (var group in groups) 
                    { 
                        RadPanelItem groupPanel = new RadPanelItem(group.Key); 
                        var orderedGr = group.OrderBy(gr => gr.link_name_sequence); 
                        foreach (var item in orderedGr) 
                        { 
                            RadPanelItem itemPanel = new RadPanelItem(item.link_name); 
                            itemPanel.Value = item.screen_id.ToString(); 
                            itemPanel.NavigateUrl = item.location_link; 
                            groupPanel.Items.Add(itemPanel); 
                        } 
                        leftMenu.Items.Add(groupPanel); 
                    } 
                } 
            } 
        } 
     
         
    } 
} 
 

Nikolay Tsenkov
Telerik team
 answered on 01 Jun 2010
3 answers
289 views
Hi

Am using a ordinary textbox and a rad input manager and Telerik textboxsetting . I want to denote mandatory field by using the character * . I had attached the screen shot for your persual. Kindly suggest me a solution .

Thanks in advance
Maria Ilieva
Telerik team
 answered on 01 Jun 2010
2 answers
100 views
Hi,
I want to set a custom ressource provider class (not a ressources file .resx)
to a WebForm RadSchduler, I don't kow how can I do that. 

I Find an example of what i wan't, but it's in winform :  http://www.telerik.com/community/code-library/winforms/localization-providers/french-radgridviewlocalization-q2-2009-sp1.aspx

thanx for your response.
N H
Top achievements
Rank 1
 answered on 01 Jun 2010
1 answer
101 views
Hi,

Can we put a line or any other seperator between nodes of tree?

Regards,
Lubna.
Nikolay Tsenkov
Telerik team
 answered on 01 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?