Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
122 views
Hi, my data looks like the following
    SELECT year(scheduledIn) [theYear] 
    , month(scheduledIn)[theMonth] 
    , scheduledIn 
    ,workOrderId 
 
    FROM            [Work Orders] 
    WHERE       aircraftID = 122 
        AND         archived = 0 
        AND completed = 1 
    ORDER BY    year(scheduledIn) DESCmonth(scheduledIn) DESC 

2008    11    2008-11-20 05:21:55.183    4949
2008    7    2008-07-09 11:53:59.307    4124
2008    7    2008-07-14 23:47:14.160    4150
2007    11    2007-11-07 00:00:00.000    2823
2007    8    2007-08-08 12:53:24.167    2304

What I need to do in the TreeView is to display it like this,,,

2008
-->-->11
-->-->-->4949
-->-->7
-->-->-->4124
-->-->-->4150
2007
-->-->11
-->-->-->2823
-->-->8
-->-->-->2304

How can I accomplish this? I need to use this form through my site for various things, so any help would be appreciated. Thanks!

Atanas Korchev
Telerik team
 answered on 08 Jun 2009
2 answers
85 views

Hi,

In the following code, the dropdown control does not render in IE 7 or IE 8 compatibility mode. Removing the form decorator control causes the dropdown to render.

I'm running .NET 2.0 and RAD Controls 2009.1.527.20.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FormDecoratorTest.aspx.cs" Inherits="FormDecoratorTest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Test</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<telerik:RadScriptManager ID="RSM1" runat="server" />
<telerik:RadFormDecorator ID="FD1" runat="server" DecoratedControls="None" />
<telerik:RadSplitter ID="RSB1" runat="server">
<telerik:RadPane ID="RP1" runat="server">
<asp:DropDownList ID="TestDDL" runat="server">
<asp:ListItem Text="Select One..." />
</asp:DropDownList>
</telerik:RadPane>
</telerik:RadSplitter>
</div>
</form>
</body>
</html>

Andrew
Top achievements
Rank 1
 answered on 08 Jun 2009
1 answer
110 views
I'm on my way to update my telerik contol set, and I encounterd a problem with Scheduler. I can not find any docimentation on changes, but direct statements - like here - that css style names are not changed! In fact when changing the control the old skin stops working in a very unplesant way...
There is any info on it?
Peter
Telerik team
 answered on 08 Jun 2009
17 answers
254 views
Hi,

After I update my trial version of the RadControls ASP.NET to the full version I started getting a JavaScript error ('childNodes' is null or not an object). Then I realized that it does not allow adding a RadMenu with no items. I'm adding an empty one to be actually created on the server-side.

I'm using the latest version of the RadControls ASPNET AJAX Q1 2009 (2009.1.402.35)

Here is the code which I could replicate the error:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TelerikTests2.WebForm1" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!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"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
    <div> 
        <telerik:RadMenu ID="RadMenu1" runat="server"
        </telerik:RadMenu> 
    </div> 
    </form> 
</body> 
</html> 
 

Isn't it possible to place an empty RadMenu on a page? Or am I doing something wrong?

Thanks,

Eduardo
Atanas Korchev
Telerik team
 answered on 08 Jun 2009
1 answer
120 views
Hello,

Here is my trouble :

I've got a master page (called PODMaster.master) which contains RadAjaxManagerProxy and a contentplaceholder as described below :

        <form id="Form1" method="post" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
        <telerik:RadAjaxManager ID="AjaxManager1" runat="server" EnableAJAX=true>  
        </telerik:RadAjaxManager> 
        <telerik:RadWindowManager Behavior=None ReloadOnShow=true Modal=true InitialBehavior=None VisibleStatusbar=false VisibleTitlebar=false id="Singleton" Skin="Default" runat="server">  
        </telerik:RadWindowManager> 
        <div> 
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">  
            </asp:ContentPlaceHolder> 
        </div> 
    </form> 
 


Then, the application loads an ascx control (called wucPOD.ascx) which contains different html tables and a contentplaceholder :
<asp:PlaceHolder ID="ContenuPage" Runat="server"></asp:PlaceHolder> 

This ascx controls loads dynamically user controls called modules.
A module is an ascx control which contains a label, a placeholder for actions buttons, and a content placeholder.

For example, imagine that I've 2 controls loaded by wucPOD.ascx in my page : controlA and controlB.
The controlA contains a RadGrid 'GrilleRetards' and the RadGrid contains action button.
The controlB contains a RadGrid 'GrillePrets'.

So what I'd like to do is when I click on the button in the RadGrid of the controlA, the RadGrid in the controlB is updated, and the 2 controls are ajaxified, of course.

What could be the best approch to perform this ?

Note that I've already done that with a RadAjaxManagerProxy on controlA and controlB.
In the controlA, on load, i've added AjaxSetting like this :
        If Not IsNothing(SessionsProfil.getModule_Pret()) Then 
            AjaxManagerProxyRetards.AjaxSettings.AddAjaxSetting(GrilleRetards, SessionsProfil.getModule_Pret())  
        End If 
 

and on the command evenement :
                    If Not IsNothing(SessionsProfil.getModule_Pret()) Then 
                        SessionsProfil.getModule_Pret().Refresh()  
                    End If 
 

But as you see, i saved the module controlB in a session variable to allow refreshing it.
And I think it's not the best approach.

I supose that I need a RadAlaxManagerProxy on the main user control wucPOD, and register each ajaxsetting in child modules (for example controlA) but I'm not sure.
And more, some modules are not ajaxified and need redirections.
So could you please tell me how I could do that ?
Thanks for your answer
Yann
Ockert
Top achievements
Rank 2
 answered on 08 Jun 2009
3 answers
132 views
I've looked all over the forums and even tryed googling for the solution with no luck.  I have 2 sites, one is the parent site that the user will be viewing and another host all the forms, we'll call it the child site, that hosts forms needed to submit info back (parent site is legacy and child are new).  The parent site has an older version of 2008.3.1314.35 of telerick ajax controls.  The child site has version 2009.01.0527.35.  I won't be able to update the parent site because it's a big site and when I tried to update it, I had over 100+ pages that errored out and with one developer it's going to take a while to resolve all the errors. 

Now my question is, is it possible for me to open a radwindow with the child site in it from the parent site and close the radwindow and refresh the parent site from a button on the child?

An off question but has to do with the parent site/ child site relationship.  How do I maximize the radwindow server side (this is using the radwindow from version 2008.3.1314.35) using follwing code?

RadWindow newwindow = new RadWindow();  
newwindow.ID = "RadWindow2";  
newwindow.NavigateUrl = url;  
newwindow.VisibleOnPageLoad = true;  
newwindow.ReloadOnShow = true;  
newwindow.OffsetElementID = button.ClientID;  
newwindow.Left = new Unit(100);  
newwindow.Top = new Unit(100);  
newwindow.Width = width;  
newwindow.Height = height;  
newwindow.Modal = true;  
newwindow.Behaviors = WindowBehaviors.Default;  
newwindow.KeepInScreenBounds = true;  
RadWindowManager1.Windows.Add(newwindow); 
Fiko
Telerik team
 answered on 08 Jun 2009
1 answer
107 views
In the online help docs i read this...

"If you would like to familiarize with the MyBusinessObjectCollection class and its Select method, it is located under the App_Code/Grid/MyBusinessObjects.cs class of the RadControls for ASP.NET AJAX installation"

Where can i find the complete download for the source files for the MyBusinessObjectCollection since can't locate App_Code with my install?

Kind regards
Andrew

Daniel
Telerik team
 answered on 08 Jun 2009
0 answers
74 views
Hello

In Safari the expanded part of the navigation shuts when you click on it. Is there a way to fix this?

Thanks

Kati
Kati
Top achievements
Rank 1
 asked on 08 Jun 2009
1 answer
74 views



Hello All,
            I am using telerik rad grid and also doing the filtering here,but it does not work properly in I.E 8.
            The problem is that the filtering takes place twice and after that the filtering is not functioning properly and after some time it will funtion

Please help me

Ritz
Daniel
Telerik team
 answered on 08 Jun 2009
3 answers
240 views
Hi All,

I'm trying to implement a combobox with checkboxes using examples found in other threads.  I have the basic functionality working except I can't get the list of selected items to appear in the text area which always shows the text for the first item in the list on page load.  Once I get this working I need to extend it to work with multiple combos on the page.  Anyway the code is below.

    public class ComboCheckBoxTemplate : ITemplate 
    { 
        public void InstantiateIn( Control container ) 
        { 
            CheckBox cb = new CheckBox(); 
            cb.ID = "ComboCheckBox"
            cb.DataBinding += new EventHandler( CheckBox_DataBinding ); 
            container.Controls.Add( cb ); 
        } 
 
        void CheckBox_DataBinding( object sender, EventArgs e ) 
        { 
            CheckBox target = (CheckBox) sender; 
            RadComboBoxItem item = (RadComboBoxItem) target.BindingContainer; 
            target.Text = (string) DataBinder.Eval( item, "Text" ); 
        } 
    } 
 
    public partial class Default : System.Web.UI.Page 
    { 
        RadComboBox Combo1 
        { 
            get { return this.RadComboBox1; } 
        } 
        protected override void OnInit( EventArgs e ) 
        { 
            RadComboBox1.ItemTemplate = new ComboCheckBoxTemplate(); 
            base.OnInit( e ); 
        } 
        protected void Page_Load( object sender, EventArgs e ) 
        { 
            if ( !this.IsPostBack ) 
                BindData(); 
            Combo1.DataBind(); 
            string str = GetCheckBoxValues( Combo1 );       // always an emtpy string here! 
            Combo1.Text = str;      // This has no effect - the combo text is always set to "Item 1" 
        } 
        protected void BindData() 
        { 
            Combo1.Items.Clear(); 
            for ( int i = 1; i < 6; i++ ) 
                Combo1.Items.Add( new RadComboBoxItem( "Item " + Convert.ToString( i ), Convert.ToString( i ) ) ); 
        } 
        protected void RadComboBox_ItemDataBound( object sender, RadComboBoxItemEventArgs e ) 
        { 
            //Add each combo checkbox to the Handler 
            ( (CheckBox) e.Item.FindControl( "ComboCheckBox" ) ).Attributes.Add( "onclick", "checkboxClick('" + ( (Telerik.Web.UI.RadComboBox) sender ).ClientID + "', 'combo1Value');" ); 
        } 
        private string GetCheckBoxValues( Telerik.Web.UI.RadComboBox comboCheckbox ) 
        { 
            StringBuilder sbValues = new StringBuilder(); 
            foreach ( Telerik.Web.UI.RadComboBoxItem rcbItem in comboCheckbox.Items ) 
            { 
                //If the box is checked return a value 
                CheckBox cb = (CheckBox) rcbItem.FindControl( "ComboCheckBox" ); 
                if ( null != cb && cb.Checked ) 
                { 
                    sbValues.Append( rcbItem.Value ); 
                    sbValues.Append( "," ); 
                } 
            } 
            //Remove Trailing comma 
            string str = sbValues.ToString(); 
            if ( str.EndsWith( "," ) ) 
                return str.Remove( sbValues.Length - 1, 1 ); 
            return str; 
        } 
        private void SetCheckBoxValues( Telerik.Web.UI.RadComboBox comboCheckbox, string csv ) 
        { 
            string[] values = csv.Split( ',' ); 
            for ( int i = 0; i <= values.Length - 1; i++ ) 
            { 
                CheckBox chkbox = (CheckBox) comboCheckbox.FindItemByValue( values[ i ] ).FindControl( "ComboCheckBox" ); 
                if ( comboCheckbox.Text == "" ) 
                    comboCheckbox.Text = string.Format( "{0}", chkbox.Text ); 
                else 
                    comboCheckbox.Text = string.Format( "{0}, {1}", comboCheckbox.Text, chkbox.Text ); 
                chkbox.Checked = true
            } 
        } 
        protected void Button1_Click( object sender, EventArgs e ) 
        { 
            //            if ( !( RadComboBox1.Text == "" ) ) 
            { 
                string str = GetCheckBoxValues( Combo1 ); 
                Label1.Text = str
            } 
        } 
        protected void Button2_Click( object sender, System.EventArgs e ) 
        { 
            BindData(); 
            SetCheckBoxValues( Combo1, TextBox1.Text ); 
        } 
    } 
 

And in Default.aspx:
    <form id="form1" runat="server"
        <script type="text/javascript"
            var supressDropDownClosing = false
             
            function OnClientDropDownClosing(sender, eventArgs) 
            { 
                eventArgs.set_cancel(supressDropDownClosing); 
            } 
             
            function OnClientSelectedIndexChanging(sender, eventArgs) 
            { 
                eventArgs.set_cancel(supressDropDownClosing); 
            } 
             
            function OnClientDropDownOpening(sender, eventArgs) 
            { 
                supressDropDownClosing = true
            } 
             
            function OnClientBlur(sender) 
            { 
                supressDropDownClosing = false
                 
                sender.toggleDropDown(); 
            } 
 
            function checkboxClick(comboid,valueid)  
            {             
                collectSelectedItems( comboid, valueid ); 
            } 
             
            function getItemCheckBox(item) 
            { 
                //Get the 'div' representing the current RadComboBox Item. 
                var itemitemDiv = item.get_element(); 
                 
                //Get the collection of all 'input' elements in the 'div' (which are contained in the Item). 
                var inputs = itemDiv.getElementsByTagName("input"); 
                 
                for (var inputIndex = 0; inputIndex < inputs.length; inputIndex++) 
                {    
                    var input = inputs[inputIndex]; 
                     
                    //Check the type of the current 'input' element. 
                    if (input.type == "checkbox") 
                    { 
                        return input; 
                    } 
                } 
                 
                return null; 
            } 
             
            function collectSelectedItems( comboid, valueid ) 
            { 
                var combo = $find(comboid); 
                var items = combo.get_items(); 
                 
                var selectedItemsTexts = ""
                var selectedItemsValues = ""
                 
                var itemsitemsCount = items.get_count(); 
                 
                for (var itemIndex = 0; itemIndex < itemsCount; itemIndex++) 
                { 
                    var item = items.getItem(itemIndex); 
                    
                    var checkbox = getItemCheckBox(item); 
                     
                    //Check whether the Item's CheckBox) is checked. 
                    if (checkbox.checked) 
                    { 
                        selectedItemsTexts += item.get_text() + ", "; 
                        selectedItemsValues += item.get_value() + ", "; 
                    } 
                } 
 
                selectedItemsTextsselectedItemsTexts = selectedItemsTexts.substring(0, selectedItemsTexts.length - 2); 
                selectedItemsValuesselectedItemsValues = selectedItemsValues.substring(0, selectedItemsValues.length - 2); 
                 
                //Set the text of the RadComboBox with the texts of the selected Items, separated by ','. 
                combo.set_text(selectedItemsTexts); 
 
                //Set the comboValue hidden field value with values of the selected Items, separated by ','. 
                document.getElementById( valueid ).value = selectedItemsValues
                 
                if (selectedItemsValues == "") 
                { 
                    combo.clearSelection(); 
                } 
            } 
        </script> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> 
        <input type="hidden" id="combo1Value" value="" runat="server" /> 
        <div>  
            <table style="width: 45%"
                <tr> 
                    <td> 
                        <telerik:RadComboBox ID="RadComboBox1" runat="server" onitemdatabound="RadComboBox_ItemDataBound"
                        </telerik:RadComboBox> 
                    </td> 
                    <td> 
                        <asp:Button ID="Button1" runat="server" Text="GetValues" onclick="Button1_Click" /> 
                    </td> 
                </tr> 
                <tr> 
                    <td> 
                        Results 
                    </td> 
                    <td> 
                        <asp:Label ID="Label1" runat="server"></asp:Label> 
                    </td> 
                </tr> 
                <tr> 
                    <td> 
                        <asp:TextBox ID="TextBox1" runat="server">1,3,5</asp:TextBox> 
                    </td> 
                    <td> 
                        <asp:Button ID="Button2" runat="server" Text="SetValues" onclick="Button2_Click" /> 
                    </td> 
                </tr> 
            </table> 
        </div> 
    </form> 
 

The text in the combo is always "Item 1".  At one point it was at least updating the text while the combo was open but that no longer works.  Also the button to set values sets the checkboxes but the item text disappears.  It reappears if the get values button is clicked.

Any help would be appreciated.

Regards,
Jim
Jim
Top achievements
Rank 1
 answered on 08 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?