Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
208 views
Hi,

I tried to get the tree to expand all nodes on initial page load, but couldn't get any of the supported Expand methods to work. What was missing?

Try #1 failed.
==========
    private void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
            RadTreeView.ExpandAllNodes();  
     }

Try #2 failed
==========
    private void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
             ExpandAllTreeNodes(RadTreeView1.Nodes);
    } 

    private void ExpandAllTreeNodes(RadTreeNodeCollection nodes)
    {
        foreach (RadTreeNode node in nodes)
        {
            node.Expanded = true;
            ExpandAllTreeNodes(node.Nodes);
        }
    }

Try #3 failed
=========
    private void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
             ExpandAllTreeNodes(RadTreeView1.Nodes);
    }

    private void ExpandAllTreeNodes(RadTreeNodeCollection nodes)
    {
        foreach (RadTreeNode node in nodes)
        {
            node.ExpandChildNodes();
        }
    }


Thanks.
Fero
Top achievements
Rank 1
 answered on 07 Feb 2008
2 answers
387 views
Hello,
OnSelectedDateChanged event of RadDatePicker(Prometheus) version control fires twice.  I have attached the code from a test project I have created to demonstrate the issue.  I cannot attach a file to the post so I am pasting the code here!.

Default.aspx:
----------------------------

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestRadCalendarPrometheus._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"> 
 
<script runat="server">  
</script> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>UpdatePanel Example</title> 
    <style type="text/css">  
    body {  
        font-family: Lucida Sans Unicode;  
        font-size: 10pt;  
    }  
    button {  
        font-family: tahoma;  
        font-size: 8pt;  
    }  
    </style> 
      
 
      
      
</head> 
<body> 
      <script type="text/javascript">  
            function pageLoad(sender, args){  
                    UpdateSpan();  
                }  
            function TogglePopUp(){  
               var datePicker = $find("<%= rdpSelectDate.ClientID %>");  
                var span = document.getElementById("dateSelector");  
                var dimSpan = datePicker.GetElementDimensions(span);  
                var position = datePicker.GetElementPosition(span);  
                  
                datePicker.ShowPopup(position.x + dimSpan.width - 142, position.y + dimSpan.height);  
            }  
             
            function UpdateSpan(){  
                var datePicker = $find("<%= rdpSelectDate.ClientID %>");  
                var date = datePicker.GetDate();  
                if (datePicker.IsEmpty())  
                 { date = new Date(); }  
                var strtDate = new Date(date);  
                var endDate = new Date(date.setDate(date.getDate() + 6));  
                var spn = document.getElementById("week");  
                spn.innerText = strtDate.format("ddd, M/d/yyyy");// + " - " + endDate.format("ddd, M/d/yyyy");  
            }  
              
              function OnDateSelected(sender, e){  
                if (e.get_NewDate() != null){  
                   UpdateSpan();  
                 }  
            }  
            function MoveSelectedDate(numDays){  
                var datePicker = $find("<%= rdpSelectDate.ClientID %>");  
                var date = datePicker.GetDate();  
                if (datePicker.IsEmpty())  
                 { date = new Date(); }  
                date.setDate(date.getDate() + numDays);  
                datePicker.SetDate(date);  
            }  
              
            function OnDayRender(calendarInstance, args){  
                var date = new Date(args._date[0], args._date[1] - 1, args._date[2]);  
                var minDate = new Date(calendarInstance.GetRangeMinDate()[0], calendarInstance.GetRangeMinDate()[1] - 1, calendarInstance.GetRangeMinDate()[2]);  
                if (date < minDate){  
                    args._cell.title = "Dates prior to 6/15/2003 cannot be selected.";  
                    return;  
                }  
                  
                  
            }  
             
 
    </script> 
    <form id="form1" runat="server">  
                <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableScriptCombine="true" ScriptMode="Auto">  
    </telerik:RadScriptManager> 
 
         <div style="margin-top:5px">  
        <span class="RundownLabelText">Date:&nbsp;</span> 
        <span id="dateSelector">  
            <span id="slctdwk" title="Day Selection" onclick="TogglePopUp();">  
                <span id="week" class="DropDownListText"></span> 
                <img id="dtpckr" alt="Calendar" src="images/calbutcon.jpg" /> 
                <img id="dwnarrw" src="images/downbutcon.jpg" alt=""/>  
            </span> 
        </span> 
    <telerik:RadDatePicker ID="rdpSelectDate" runat="server" SharedCalendarID="RadCalendar1"    
      OnSelectedDateChanged= "rdpSelectDate_SelectedDateChanged" AutoPostBack="true" > 
        <DateInput ID="DateInput1" runat="server" ReadOnly="true" style="display:none;"></DateInput> 
        <ClientEvents OnDateSelected="OnDateSelected"/>     
        <DatePopupButton style="display:none;" /> 
    </telerik:RadDatePicker> 
    <telerik:RadCalendar ID="RadCalendar1" runat="server" EnableMultiSelect="true" UseColumnHeadersAsSelectors="false" ShowRowHeaders="false" FirstDayOfWeek="Monday" Skin="WebBlue"    
        RangeMinDate="6/16/2003" NavigationNextToolTip="" NavigationPrevToolTip="">  
        <ClientEvents OnDayRender="OnDayRender" /> 
    </telerik:RadCalendar> 
    </div>    
              
    </form> 
</body> 
</html> 
 
Default.aspx.cs
using System;  
using System.Data;  
using System.Configuration;  
using System.Collections;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
using Telerik.Web.UI.Calendar;  
 
namespace TestRadCalendarPrometheus  
{  
    public partial class _Default : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
        }  
 
 
        protected void rdpSelectDate_SelectedDateChanged(object sender, SelectedDateChangedEventArgs e)  
        {  
            Session["ListDate"] = rdpSelectDate.SelectedDate.Value;  
        }  
    }  
}  
 
I am using Telerik.Web.UI dll with version # 2007.3.1314.20
System.Web.Extensions Dll verison # 1.0.61025.0.
I am not copying the web.config as I think it is unnecessary but let me know if you need it.
Put a break point in the OnSelectedDateChanged event handler and notice how it will break twice of a singe click on the calendar.

Your help is appreciated

Thanks
Raj
Raj Nemani
Top achievements
Rank 1
 answered on 06 Feb 2008
2 answers
121 views
Hi,

Can I use a WCF service to load nodes on demand on the TreeView? I modified the sample from "Load on Demand > Web Service" to point to a WCF service. The service works fine but when it's called by the TreeView i get an error "The server method 'GetTreeViewCategories' failed". Is there a modified example using WCF?

Thanks!
relper
Top achievements
Rank 1
 answered on 06 Feb 2008
1 answer
76 views
From what I've read on these forums, the RadPanelbar won't be released until Prometheus is out of beta.   Is this still true?  If not, is there a planned date for the RadPanelbar's first appearance?
Ivo
Telerik team
 answered on 06 Feb 2008
5 answers
353 views

When text needs to wrap within a tree view it is leaving empty space next to the node image and putting the text on the next line...e.g.

[img] Parent Node
      [img] Child Node
      [img] Child Node
      [img]
      Child Node with very long text that woul
      cause wrapping.
This doesn't present very well and is the result of placing the TreeView within any container that constrains the width of the tree (e.g. Div with overflow:auto).

This could be resolved if Telerik would put the <span> tag inside the <div> tag that contains the image instead of outside it...here is the code you generate today:
<div class="rtBot" style="border: 0px none black;">
<div class="rtAux">
<img class="rtImg"
src="/mx/images/minicons/folder_images.gif"
 alt=""/>
</div>
<span class="rtIn">
Child Node with very long
text that would cause wrapping.</span>
</div>
Here is the code that would act properly:
<div class="rtBot" style="border: 0px none black;">
<div class="rtAux">
<img class="rtImg"
src="/mx/images/minicons/folder_images.gif"
 alt=""/>
<span class="rtIn">
Child Node with very long text
that would cause wrapping.</span> </div> </div>
.rtImg and rtIn are both defined with float: left so the resulting presentation would be:
[img] Parent Node
      [img] Child Node
      [img] Child Node
      [img] Child Node with very long text that would
            cause wrapping.
...which at least in my opinion is more aesthetically pleasing and is the generally expected behavior of a tree view when wrapping is required.

Thanks for your time and consideration of the matter.


Michael Dunbar
Top achievements
Rank 2
 answered on 06 Feb 2008
1 answer
90 views
Hi,

Is it possible to load the root level for a RadMenu prometheus on demand when used as a context menu in a RadGrid?

I have a scenario where I have grid where I need to move all actions (edit, delete and some special commands) to a context menu to save space on the row. Depending on the access rights of the user they don't neccessarily have the right to delete all rows they can see so the menu items must be loaded on demand so I can decide which items to show for the current grid row.

Do I have to make a root element in the menu, e.g. Actions, and set its ExpandMethod to WebService to be able populate the on-demand items or can I load the root level of the menu on-demand as well?

Regards,
Mathias
Peter
Telerik team
 answered on 06 Feb 2008
1 answer
235 views
Hi,

We are using Telerik chart in our Project with DNN Framework.
We would like to use the skins provided by telerik in our chart and also to override the bar colors of the existing skin. But we are not able to overrite the default bar colors provided by the telerik in the skin.

Eg. Chart with skin color "Light Green". Bars  are having the same color.
we are setting the  bar color of the chart programatically like below using a fucntion and this function is called after databinding and setting the chart properties programatically

Private

Sub SetColourRange()

For Each item As Telerik.Charting.ChartSeriesItem In Me.RadChart1.Series.Item(0).Items

If item.YValue <= 40 Then

item.Appearance.FillStyle.MainColor = Drawing.Color.Red

item.Appearance.FillStyle.SecondColor = Drawing.Color.Pink

ElseIf item.YValue <= 60 Then

item.Appearance.FillStyle.MainColor = Drawing.Color.Yellow

item.Appearance.FillStyle.SecondColor = Drawing.Color.Silver

ElseIf item.YValue > 60 Then

item.Appearance.FillStyle.MainColor = Drawing.Color.Green

item.Appearance.FillStyle.SecondColor = Drawing.Color.GreenYellow

End If

Next

End Sub


But we are hopeless. Bar color remains unchanged. Is there a way to override the bar color of the chart after setting desired skin.

Ves
Telerik team
 answered on 06 Feb 2008
4 answers
119 views
I have multiple editors on 1 page, each with their own toolbar.  Toolbars lower down on the page seem to activate the top toolbar, when you select for example the LinkManager, DocumentManager or whatever...

Has anyone come across this glitch and know how to fix it?

Thanks
Steven Gladstone
Top achievements
Rank 1
 answered on 06 Feb 2008
1 answer
136 views
Hi,
I want to know if it is possible to integrate the RadDock with the RadScheduler. The idea is that we have raddock objects on the page which we can then drag into the scheduler. Each scheduler cell will have some sort of docking zone, of which we will be able to know what cell of the scheduler it resides in.
With this info, we can then create appointments based on the data from the raddock object....

Is this possible? If so, does anyone have any idea on where to start?

Thanks in advance,

Fayez
Peter
Telerik team
 answered on 06 Feb 2008
2 answers
90 views
Hi,

I cannot find the answer to this anywhere in the help or forums.  How can I ajaxify the pager on the grid?  When the user selects any button within the pager, I want to be able to reload the grid for the requested page with ajax.  Is this possible?

Thanks in advance.
Jonathan
Top achievements
Rank 1
 answered on 06 Feb 2008
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?