I have problem to add RadDatePicker in control that control further add in RadDock dynamincally

3 posts, 0 answers
  1. Harsh Verma
    Harsh Verma avatar
    8 posts
    Member since:
    Jul 2009

    Posted 01 Jul 2009 Link to this post

    Background:  
    I am trying to create a RadDock  dynamically on an .aspx Page and further adding a Control(.acsx) in RadDock. The .acsx Control has a RadDatePicker, RadComboBox, asp:ImageButton controls etc in it. The .aspx page also contains a RadComboBox.

    Issue:
    In that Page, I need to repopulate the RadDock with Control when the RadDock moves from a RadDockZone to other RadDockZone .

    I am try create this page with help of example that is published on the telerik site(Dynamically add Raddock)

    I am getting some errors when I am trying to do so:

    1.Sys.InvalidOperationException: Type Telerik.Web.UI.Orientation has already been registered.

    2.Sys.InvalidOperationException: Type Telerik.Web.UI.RadComboBoxEventArgs has already been registered.

    3.Sys.InvalidOperationException: Type Telerik.Web.UI.AttributeCollection has already been registered.

    4.(missing : after property id)  Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadCalendar, {"_DayRenderChangedDays":{},"_FormatInfoArray":[["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["January","February","March","April","May","June","July","August","September","October","November","December",],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",],"dddd, MMMM dd, yyyy h:mm:ss tt","dddd, MMMM dd, yyyy","h:mm:ss tt","MMMM dd","ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","M/d/yyyy","h:mm tt","yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","MMMM, yyyy","AM","PM","/",":",0],"_ViewRepeatableDays":{},"_ViewsHash":{ctl00_MainCntrl_RadDock23512acf-a922-4af4-b1d3-871a17563fb3_C_widget_gridCalenderEventOrder_ctl00_ctl06_RadDatetxtFirstTextBox_calendar_Top : [[2009,7,1], 1]},"_calendarWeekRule":0,"_culture":"en-US","_enableViewSelector":false,"_firstDayOfWeek":7,"_postBackCall":"__doPostBack(\u0027ctl00$MainCntrl$RadDock23512acf-a922-4af4-b1d3-871a17563fb3$C$widget$gridCalenderEventOrder$ctl00$ctl06$RadDatetxtFirstTextBox$calendar\u0027,\u0027@@\u0027)","clientStateFieldID":"ctl00_MainCntrl_RadDock23512acf-a922-4af4-b1d3-871a17563fb3_C_widget_gridCalenderEventOrder_ctl00_ctl06_RadDatetxtFirstTextBox_calendar_ClientState","enabled":true,"monthYearNavigationSettings":["Today","OK","Cancel","Date is out of range.","False"],"skin":"Office2007","specialDaysArray":[],"stylesHash":{DayStyle: ["", ""],CalendarTableStyle: ["", "rcMainTable"],OtherMonthDayStyle: ["", "rcOtherMonth"],TitleStyle: ["", ""],SelectedDayStyle: ["", "rcSelected"],SelectorStyle: ["", ""],DisabledDayStyle: ["", "rcDisabled"],OutOfRangeDayStyle: ["", "rcOutOfRange"],WeekendDayStyle: ["", "rcWeekend"],DayOverStyle: ["", "rcHover"],FastNavigationStyle: ["", "RadCalendarMonthView RadCalendarMonthView_Office2007"],ViewSelectorStyle: ["", "rcViewSel"]},"useColumnHeadersAsSelectors":false,"useRowHeadersAsSelectors":false}, null, null, $get("ctl00_MainCntrl_RadDock23512acf-a922-4af4-b1d3-871a17563fb3_C_widget_gridCalenderEventOrder_ctl00_ctl06_RadDatetxtFirstTextBox_calendar"));
    });

    There is the code I am using to add the control in the RadDock

     Control widget = (Control)LoadControl(TagArr1[1]); //TagArr1[1] Control Url
     WidgetsControl_CalenderComponent widgetControl = (WidgetsControl_CalenderComponent)widget;

     dock.ContentContainer.Controls.Add(widget);
     widgetControl.IsSchoolHomePage = SessionInfo.IsSchoolHome;

    Please let me know, how I can I avoid these errors?

    Thank in advance
    Harsh Verma
                                                                                                                                                          
                                                          













  2. Harsh Verma
    Harsh Verma avatar
    8 posts
    Member since:
    Jul 2009

    Posted 02 Jul 2009 Link to this post

    Background:  
    I am trying to create a RadDock  dynamically on an .aspx Page and further adding a Control(.acsx) in RadDock. The .acsx Control has a RadDatePicker, RadComboBox, asp:ImageButton controls etc in it. The .aspx page also contains a RadComboBox.

    Issue:
    In that Page, I need to repopulate the RadDock with Control when the RadDock moves from a RadDockZone to other RadDockZone .

    I am try create this page with help of example that is published on the telerik site(Dynamically add Raddock)

    I am getting some errors when I am trying to do so:

    1.Sys.InvalidOperationException: Type Telerik.Web.UI.Orientation has already been registered.

    2.Sys.InvalidOperationException: Type Telerik.Web.UI.RadComboBoxEventArgs has already been registered.

    3.Sys.InvalidOperationException: Type Telerik.Web.UI.AttributeCollection has already been registered.

    4.(missing : after property id)  Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadCalendar, {"_DayRenderChangedDays":{},"_FormatInfoArray":[["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["January","February","March","April","May","June","July","August","September","October","November","December",],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",],"dddd, MMMM dd, yyyy h:mm:ss tt","dddd, MMMM dd, yyyy","h:mm:ss tt","MMMM dd","ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","M/d/yyyy","h:mm tt","yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","MMMM, yyyy","AM","PM","/",":",0],"_ViewRepeatableDays":{},"_ViewsHash":{ctl00_MainCntrl_RadDock23512acf-a922-4af4-b1d3-871a17563fb3_C_widget_gridCalenderEventOrder_ctl00_ctl06_RadDatetxtFirstTextBox_calendar_Top : [[2009,7,1], 1]},"_calendarWeekRule":0,"_culture":"en-US","_enableViewSelector":false,"_firstDayOfWeek":7,"_postBackCall":"__doPostBack(\u0027ctl00$MainCntrl$RadDock23512acf-a922-4af4-b1d3-871a17563fb3$C$widget$gridCalenderEventOrder$ctl00$ctl06$RadDatetxtFirstTextBox$calendar\u0027,\u0027@@\u0027)","clientStateFieldID":"ctl00_MainCntrl_RadDock23512acf-a922-4af4-b1d3-871a17563fb3_C_widget_gridCalenderEventOrder_ctl00_ctl06_RadDatetxtFirstTextBox_calendar_ClientState","enabled":true,"monthYearNavigationSettings":["Today","OK","Cancel","Date is out of range.","False"],"skin":"Office2007","specialDaysArray":[],"stylesHash":{DayStyle: ["", ""],CalendarTableStyle: ["", "rcMainTable"],OtherMonthDayStyle: ["", "rcOtherMonth"],TitleStyle: ["", ""],SelectedDayStyle: ["", "rcSelected"],SelectorStyle: ["", ""],DisabledDayStyle: ["", "rcDisabled"],OutOfRangeDayStyle: ["", "rcOutOfRange"],WeekendDayStyle: ["", "rcWeekend"],DayOverStyle: ["", "rcHover"],FastNavigationStyle: ["", "RadCalendarMonthView RadCalendarMonthView_Office2007"],ViewSelectorStyle: ["", "rcViewSel"]},"useColumnHeadersAsSelectors":false,"useRowHeadersAsSelectors":false}, null, null, $get("ctl00_MainCntrl_RadDock23512acf-a922-4af4-b1d3-871a17563fb3_C_widget_gridCalenderEventOrder_ctl00_ctl06_RadDatetxtFirstTextBox_calendar"));
    });

    There is the code I am using to add the control in the RadDock

     Control widget = (Control)LoadControl(TagArr1[1]); //TagArr1[1] Control Url
     WidgetsControl_CalenderComponent widgetControl = (WidgetsControl_CalenderComponent)widget;

     dock.ContentContainer.Controls.Add(widget);
     widgetControl.IsSchoolHomePage = SessionInfo.IsSchoolHome;

    Please let me know, how I can I avoid these errors?

    Thank in advance
    Harsh Verma
                                                                                                                                                          
                                                          













  3. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 06 Jul 2009 Link to this post

    Hello Harsh,


    We were able to recreate the problem on our side by creating a sample project that dynamically adds RadDocks (with RadDatePicker inside) to a RadDockZone. The problem seems to be caused by the following code line:
    dock.ID = Guid.NewGuid().ToString(); 
    It returns an ID which
    contains "-". By default you cannot use strings as IDs of ASP.NET controls that contain the "-" character. So the "-" character should be replaced with a "legal" ASP.NET character. For an example this line of code should be used instead:
    dock.ID = Guid.NewGuid().ToString().Replace('-', 'a') ; 
      
    One of our examples for dynamic RadDock creation uses the code line that causes the error. That might have led you to the problem. We apologize for the inconvenience, and we will  fix it as soon as we can.



    Sincerely yours,
    Pero
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top