Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
646 views
Hi

I am currently upgrading our Telerik controls from Telerik.WebControls to the latest version of the Telerik.Web.UI controls.

I have replaced all of the old references and matched these to the new dll reference in the pages. Updated all methods/properties/declarations that have changed.

However, i am repeatedly getting this error on the page which is setup with an aspx page with many ascx controls registered to that aspx page:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).


I have read your forums regarding place all script out of the head tag and inside the body, replace all <%= with <%#, and wrap any script in a <RadCodeBlock> however none of this is working.

I am needing urgent help on this error!

Regards,
Jonathan
Veli
Telerik team
 answered on 06 Jan 2012
1 answer
198 views
Hi All,
I have 2 comboboxes on page both i have bind load on demand, both are working well but i want to get selected value of first combobox on second combobox OnItemsRequested Event but when second combobox event OnItemsRequested fires the selected value of first combobox is null my code is follws
<telerik:RadComboBox ID="rcbCategory" runat="server" EmptyMessage="Select Category"
                            OnItemsRequested="rcbCategory_OnItemsRequested" EnableLoadOnDemand="true" EnableViewState="true">
                        </telerik:RadComboBox>
 
<telerik:RadComboBox ID="rcbSubCategory" runat="server" OnItemsRequested="rcbSubCategory_OnItemsRequested"
                            EnableLoadOnDemand="true" EmptyMessage="Select Sub-Category">
                        </telerik:RadComboBox>
 
 
C#
protected void rcbCategory_OnItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            rcbCategory.DataSource = Category.GetAll();
            rcbCategory.DataValueField = "ID";
            rcbCategory.DataTextField = "CategoryName";
            rcbCategory.DataBind();
        }
 
        protected void rcbSubCategory_OnItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            rcbSubCategory.DataSource = SubCategory.GetAll(rcbCategory.SelectedValue);
            rcbSubCategory.DataValueField = "ID";
            rcbSubCategory.DataTextField = "CategoryName";
            rcbSubCategory.DataBind();
        }
Ivana
Telerik team
 answered on 06 Jan 2012
11 answers
444 views
Hi,
I have used Rad ComboBox is my web page. its dropdown is showing correctly in Firefox, but not correctly in Google Chrome. In the source, the Rad Combobox is located under a <div> (I didn't use radsplitter in the web page). I didn't found the solution in the telerik forum, although, there must be many different posts on this topic here in the forums. 
I attached a file the this post.

Thanks,
Mounir

Ivana
Telerik team
 answered on 06 Jan 2012
4 answers
168 views
Hello,

I am using RadTabStrip. Inside this multiple tab strip there are usercontrols loaded. In one of the user control I have a RadComboBox with OnItemRequested even. I want to load this combobox with the selected values using OnItemRequested event.

But the OnItemRequested  event handeler is not envoked when i try to enter some text in the RadComboBox.

Can you please guide me ? what could be the possible way to make to enable to call this event handler ?

Note: I used EnableAutomaticLoadOnDemand="true" and also put the all controls in UpdatePanel.

Thanks,
Prayag
Ivana
Telerik team
 answered on 06 Jan 2012
1 answer
151 views

Our application has RadWindow ,which is displayed as pop up window with some information.We are trying to open the links in the RadWindow in a new browser window - through the Ajax Manager by adding the Javascript method to the RadAjaxManager response scripts and sending the parameters from code behind.The script has been added to the Response scripts.but the javascript is not getting executed.

Is there any other way to do this? or is this the right approach.



Thanks
Chandra
Marin Bratanov
Telerik team
 answered on 06 Jan 2012
2 answers
180 views
1) RadScheduler context menu does not fire AppointmentContextMenuItemClicked event.

(version 2011.3.1227.40)

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Web.Script.Services;
using System.Web.Services;
using Telerik.Web.UI;
 
namespace Naucrates.Formcrates.Web.Form
{
    [WebService]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ScriptService]
    public partial class TestScheduler : System.Web.UI.Page
    {
        protected void Page_Init(object sender, EventArgs e)
        {
            var Control = new RadScheduler();
            Control.ID = "test";
            Page.Form.Controls .Add(Control);
            Control.AllowDelete = false;
            Control.AllowEdit = false;
            Control.AllowInsert = false;
            Control.FirstDayOfWeek = DayOfWeek.Monday;
            Control.LastDayOfWeek = DayOfWeek.Sunday;
            Control.ShowFullTime = false;
 
 
            Control.SelectedView = SchedulerViewType.MonthView;
            Control.ShowViewTabs = true;
 
            Control.ShowAllDayRow = true;
            Control.DayView.UserSelectable = false;
            Control.WeekView.UserSelectable = false;
            Control.TimelineView.UserSelectable = false;
 
            Control.WebServiceSettings.Path = Request.Url.AbsoluteUri;
            Control.WebServiceSettings.ResourcePopulationMode = SchedulerResourcePopulationMode.ClientSide;
 
 
            Control.TimeZoneOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
            Control.VisualTimeZoneOffset = Control.TimeZoneOffset;
            Control.Culture = new CultureInfo("cs-CZ");
 
            Control.ShowDateHeaders = false;
            var menu = new RadSchedulerContextMenu();
            menu.Items.Add(new RadMenuItem("test1"));
            menu.Items.Add(new RadMenuItem("test2") { PostBack = true, Value = "val" });
            Control.AppointmentContextMenus.Add(menu);
 
            Control.AppointmentContextMenuItemClicked += Control_AppointmentContextMenuItemClicked;
            Control.AppointmentContextMenuItemClicking += Control_AppointmentContextMenuItemClicking;
        }
 
        void Control_AppointmentContextMenuItemClicking(object sender, AppointmentContextMenuItemClickingEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("CLICKING!");
        }
 
        protected void Control_AppointmentContextMenuItemClicked(object sender, AppointmentContextMenuItemClickedEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("CLICK!");
        }
 
        [WebMethod]
        public static IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo)
        {
            var data = new List<AppointmentData>();
            data.Add(new AppointmentData {Start = DateTime.Today, End = DateTime.Today.AddDays(2),Description = "TEST", Subject = "test"});
            return data;
        }
 
        [WebMethod]
        public static IEnumerable<ResourceData> GetResources(SchedulerInfo schedulerInfo)
        {
            return new List<ResourceData>();
        }
    }
}



2) Culture property does not working properly (see image).

What am I doing wrong?
Thanks,
Tomas Svec


Ivana
Telerik team
 answered on 06 Jan 2012
3 answers
655 views
Hi I have a RadWindow Generated at runtime based on certain condition , it also attaches itself to the RadWindowManager...
On first page load, the ID is set to "wndSetUp"... and on that page i have a button, when i click on the button to execute an onclick to display the radwindow, it postback , so on the next page load, i try to find the RadWindow using the FindControl("wndSetUp")  but coudlnt find it... it turned out the ID has changed to a defaut "ctl02" rather than "wndSetUp" ( which it was correct on first page load)...

In the Watch Window, the ID clearly changes when I click on the button.
Can anyone explain to me why the ID?

Code of Master Page which has the onClick Button
 
        protected void Page_Load(object sender, EventArgs e)
        {
            //Check if Calling Pages Require New User Set Up
            if (SessionContext.NeedUserSetUp)
            {
                // Find Reference to Window Set Up
                RadWindow wndSetUp = GetUserSetUpWindow();
                if (wndSetUp != null)
                {// Show Set Up Button and Add Ajax Settings
                    btNewUserSetUp.Visible = true;
                    RadAjaxManager_GM.AjaxSettings.AddAjaxSetting(btNewUserSetUp, wndSetUp);
                }
                else
                {
                    btNewUserSetUp.Visible = false;
                }
            }
            else
            {
                btNewUserSetUp.Visible = false;
            }
        }
 
      /// <summary>
        /// Handles the Click event of the btNewUserSetUp control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void btNewUserSetUp_Click(object sender, EventArgs e)
        {
            RadWindow wndSetup = GetUserSetUpWindow();
            if (wndSetup != null)
            {
                wndSetup.Visible = true;
                wndSetup.VisibleOnPageLoad = true;
            }
        }
 
        /// <summary>
        /// Gets the user set up window. Find the Reference to the Window Set Up generated dynamically
        /// </summary>
        /// <returns></returns>
        private RadWindow GetUserSetUpWindow()
        {
            switch (sectionName)
            {
                case "SavingsCenter":
                case "ShoppingLists":
                case "BrowseItems":
                case "FindDeals":
                default:
                    return (RadWindow)Page.Form.FindControl("RadWindowManager_GM").FindControl("wndSetUp");
            }
        }
 
 
 
HTML
            <telerik:RadWindowManager ID="RadWindowManager_GM" runat="server">
            </telerik:RadWindowManager>
 
                <telerik:RadButton ID="btNewUserSetUp" runat="server" Visible="false" Width="98"
                    Height="21" OnClick="btNewUserSetUp_Click">
                    <Image ImageUrl="../Images/btNewUserSetUp.gif" HoveredImageUrl="../Images/btNewUserSetUp_up.gif" />
                </telerik:RadButton>

On My PageBASE class, inheritted by my pages, it checks a wnSetUp needs to be created using the 3 conditions: NeedUserSetUp, IsValidContext and !IsPostBack. My Work around is tp force a new creation of "wndSetUp" RadWindow (by removing the !IsPOstBack)... but in the end i had 2 RadWindows ( one with "ct02" and the other one since I recreated it on the postback with "wndSetUp")

protected override void OnLoad(EventArgs e)
 {
         _SessionContext.CallingPage = this;
     //Check for New User Set Up
     if (SessionContext.NeedUserSetUp && IsValidContext() && !IsPostBack)
     {
         RadWindow wndSetUp = CreateNewUserSetUpWindow(true);
     }
 
 
     base.OnLoad(e);
 }
 
 /// <summary>
 /// Determines whether [is valid context] only if PageBase called within the ApplicationLayer.
 /// </summary>
 /// <returns>
 ///   <c>true</c> if [is valid context]; otherwise, <c>false</c>.
 /// </returns>
 private bool IsValidContext()
 {
     MasterPage master = GetRootLevelMaster();
     return (master != null ? (master.GetType().Name.IndexOf("applicationlayer") > 0) : false);
 }
 
 
 /// <summary>
 /// Creates the new user set up window.
 /// </summary>
 /// <param name="manualSetUp">if set to <c>true</c> [manual set up].</param>
 /// <returns></returns>
 public RadWindow CreateNewUserSetUpWindow(bool manualSetUp)
 {
     RadWindow wndSetUp = new RadWindow();
     WindowSetUpConfigurations(wndSetUp, manualSetUp);
 
     RadWindowManager wndManager = (RadWindowManager)GetWindowManager();
     wndManager.Windows.Add(wndSetUp);
 
     //Attach RadWindow to the Form
     //this.Page.Form.Controls.Add(wndSetUp);
     return wndSetUp;
 }
 
 private Control GetWindowManager()
 {
     MasterPage master = GetRootLevelMaster();
     return master.FindControl("RadWindowManager_GM");
 }
 
 private MasterPage GetRootLevelMaster()
 {
     MasterPage master = Page.Master;
     MasterPage prevMaster = null;
 
     while (master != null)
     {
         prevMaster = master;
         master = master.Master;
     }
     return prevMaster;
 }
 
 
 /// <summary>
 /// Windows the set up configurations.
 /// Requirement: CSS Skin is loaded for RadWindow in Master
 /// </summary>
 /// <param name="wndSetUp">The WND set up.</param>
 private void WindowSetUpConfigurations(RadWindow wndSetUp,bool manualSetUp)
 {
     wndSetUp.ID = "wndSetUp";
     if (manualSetUp)
     {
         RadButton btSetUp = (RadButton)GetWindowManager().FindControl("btNewUserSetUp");
         wndSetUp.OpenerElementID = btSetUp.ClientID;
     }
     wndSetUp.Title = "First Time Setup";
     wndSetUp.Skin = "gmBlue";
     wndSetUp.NavigateUrl = "../Pages/InitialSetUp.aspx";
     wndSetUp.Height = 730;
     wndSetUp.Width = 900;
     wndSetUp.KeepInScreenBounds = true;
     wndSetUp.Modal = true;
     wndSetUp.Overlay = true;
     wndSetUp.ShowContentDuringLoad = true;
     wndSetUp.Visible = false;
     wndSetUp.VisibleStatusbar = false;
     wndSetUp.VisibleTitlebar = true;
     wndSetUp.Behaviors = WindowBehaviors.Close | WindowBehaviors.Move;
     wndSetUp.EnableEmbeddedSkins = false;
     wndSetUp.EnableShadow = false;
 }
Marin Bratanov
Telerik team
 answered on 06 Jan 2012
1 answer
152 views
Hi,
I have rad scheduler  and i have some appointments in my Scheduler.How i can Open a Modal popup to show appointment  details by click on a particular Appointment.Can any one help me asap

Thanks And Regards
N.Vishnu Vardhan Reddy
Peter
Telerik team
 answered on 06 Jan 2012
3 answers
321 views
Hi,

I have a requirement of binding Daily points on to the Charts. On the X-Axis i am trying to show the Label of some 5 dates and hiding all the other labels. I want to show the major ticks for which Dates are being displayed and hide all the minor ticks. Is this possible to show only Major and not the Minor ticks when binding dynamically. 
Peshito
Telerik team
 answered on 06 Jan 2012
5 answers
446 views
Hi,
i am using RadWindow in my Portal and i have few text box on my Radwindow and one Image Button..... i want to know that how to Close my Radwindow and Redirect page to parent page when i click on Image button which is on Radwindow ..can any one help me???
Marin Bratanov
Telerik team
 answered on 06 Jan 2012
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?