getting an error when i create the RadDateTimePicker dynamically

20 posts, 0 answers
  1. CoolAggie
    CoolAggie avatar
    11 posts
    Member since:
    Aug 2009

    Posted 25 Aug 2009 Link to this post

    I am trying to create the RadDateTimePicker control dynamically in my code. i am getting expected ':'
    I am able to add the textbox control , RadDateInput, RadTimePicker controls easily without an error but i am not able to add RadDatePicker and RadDateTimePicker.
     here is my code

     Case "datetimeend"
                   Dim cal2 As New Telerik.Web.UI.RadDateTimePicker
                    cal2.ID = parameterid

                    ctrls.Add(cal2)

    i have <asp:ScriptManager ID="ScriptManager1" runat="server" /> on the aspx page.

  2. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 27 Aug 2009 Link to this post

    Hello Rajeev

    May I ask you to post a runnable code-snippet that demonstrate your approach? I would like to investigate this behavior locally. Please also let me know the version of RadControls used in your scenario.

    Best regards,
    Daniel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. CoolAggie
    CoolAggie avatar
    11 posts
    Member since:
    Aug 2009

    Posted 28 Aug 2009 Link to this post


    I don't know what ver is the dll. but i downloaded the controls on  8/17/2009 from ur website

    this the msi file i ran RadControls_for_ASP.NET_AJAX_2009_2_701_trial.msi

    One more question what kind of support do i get during the trail period?

    Sub AddCustomAttribute(ByVal parameterid As String, ByVal DisplayedName As String, ByVal ParameterType As Object, ByVal ParameterName As String, ByVal DataSource As String, ByVal Hidden As String, ByVal DefaultValue As String, ByVal DatabaseSourceNumber As String)
            'Add a row to CustomUITable
            Dim tr As New TableRow

            'Add the name as the left cell
            Dim tdName As New TableCell
            tdName.Text = DisplayedName
            tdName.VerticalAlign = VerticalAlign.Top
            tr.Cells.Add(tdName)

            'Add the UI as the right cell
            Dim UIControls As List(Of Control) = CreateCustomAttributeUI(parameterid, DisplayedName, ParameterType, ParameterName, DataSource, Hidden, DefaultValue, DatabaseSourceNumber)

            Dim tdUI As New TableCell
            tdUI.VerticalAlign = VerticalAlign.Top
            For Each ctrl As Control In UIControls
                tdUI.Controls.Add(ctrl)
            Next
            tr.Cells.Add(tdUI)

            CustomUITable.Rows.Add(tr)
        End Sub




    Private Function CreateCustomAttributeUI(ByVal parameterid As String, ByVal DisplayedName As String, ByVal ParameterType As Object, ByVal ParameterName As String, ByVal DataSource As String, ByVal Hidden As String, ByVal DefaultValue As String, ByVal DatabaseSourceNumber As String) As List(Of Control)
            Dim iCalendar As Integer = 0
            Dim iListBox As Integer = 0
            Dim iTextBox As Integer = 0
            Dim ctrls As New List(Of Control)
           
            conn.Open()


            Select ParameterType

    ' here i am getting the error. on the RadDateTimePicker. I am able to make the RadTextBox control fine below
    ' and i was able to create other controls fine fine just for test purposes .

                Case "datetimestart", "datetime"
                    Dim cal2 As New Telerik.Web.UI.RadDateTimePicker
                    cal2.ID = parameterid
                    ctrls.Add(cal2)


                Case "datetimeend"          
             
                    Dim cal2 As New Telerik.Web.UI.RadDateTimePicker
                    cal2.ID = parameterid
                    ctrls.Add(cal2)
            

         Case "number", "numberblank"
                     Dim cal22 As New Telerik.Web.UI.RadTextBox
             cal22.ID = parameterid
                    cal22.Text = DefaultValue
                    ctrls.Add(cal22)

    ' this is  i am creating without using ur controls
    Case "stringm", "numberm" 'Enter multiple values separated by commas
                    Dim tb As New TextBox
                    tb.ID = parameterid
                    tb.Text = DefaultValue
                    tb.TextMode = TextBoxMode.SingleLine
                    ctrls.Add(tb)
        End Select
            Return ctrls
        End Function
  4. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 02 Sep 2009 Link to this post

    Hi rajeev,

    The support options with your trial package are listed on this page on our site:
    http://www.telerik.com/support/technical-support-options.aspx

    The latest version of our controls is Q2 2009 SP1 (2009.2.826) and how to migrate to it you can see from the kb article below:
    http://www.telerik.com/support/kb/aspnet-ajax/general/updating-radcontrols-for-asp-net-to-another-version-or-license.aspx

    Greetings,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. CoolAggie
    CoolAggie avatar
    11 posts
    Member since:
    Aug 2009

    Posted 02 Sep 2009 Link to this post

    I updated the DLL and still it gives the same error.

  6. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 03 Sep 2009 Link to this post

    Hi rajeev,

    Can you please verify that the parameterid value you assign for the dynamically created RadDateTimePicker or RadTextBox does not contain special characters like ":", ";", etc.? They may cause this error to be generated.

    Best regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. CoolAggie
    CoolAggie avatar
    11 posts
    Member since:
    Aug 2009

    Posted 03 Sep 2009 Link to this post

    The parameter value is an int. there are no characters like this u mentioned.. i used the debug to see the value of the paramaterid.
    so how do we solve this issue. all the other controls work fine except these two.
  8. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 03 Sep 2009 Link to this post

    Hi rajeev,

    What happens if you explicitly define string values for the ids of the date time picker and textbox? Using integer values for ids of server controls is not a good practice.

    Regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. CoolAggie
    CoolAggie avatar
    11 posts
    Member since:
    Aug 2009

    Posted 03 Sep 2009 Link to this post

    IF i hardcode the cal.id it still doesn't work

    I am passing ByVal parameterid As String not int

    it works if i do like this or if i comment the cal2.id

     Dim cal2 As New Telerik.Web.UI.RadDateTimePicker
                    cal2.ID = "test"
                    ctrls.Add(cal2)

    if i do like this it doesn't work. it gives expected ':'
    Dim cal2 As New Telerik.Web.UI.RadDateTimePicker
                    cal2.ID = "1234"
                    ctrls.Add(cal2)

    If i do like this. add a colon to the end of 1234. then it gives error expected '}'
    Dim cal2 As New Telerik.Web.UI.RadDateTimePicker
                    cal2.ID = "1234:"
                    ctrls.Add(cal2)

    The textbox control works fine. It doesn't throw any error.

    Dim cal22 As New Telerik.Web.UI.RadTextBox
                    cal22.ID = parameterid
                    cal22.Text = DefaultValue
                    ctrls.Add(cal22)
  10. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 04 Sep 2009 Link to this post

    Hello rajeev,

    I am not able to reproduce the issue you explained locally despite my efforts. At this point the best means to progress in our investigation is to isolate a simple working version of your project, exhibiting it, and send it enclosed to a regular support ticket. I will test/debug it locally and will get around to you with my findings.

    Kind regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. CoolAggie
    CoolAggie avatar
    11 posts
    Member since:
    Aug 2009

    Posted 04 Sep 2009 Link to this post

    When i do a viewsource of the page  the error comes on this line. it is missing a colon somewhere here.  IF you copy the code below and paste in Visual studio it shows the error.
    It just doesn't like numbers.

    Let me know if u still need the project.

    This is the line that gives error starts from calendar top
    $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":{123456_calendar_Top : [[2009,9,1], 1]},"_calendarWeekRule":0, "_culture":"en-US","_enableViewSelector":false,"_firstDayOfWeek":7,"_postBackCall":"__doPostBack(\u0027123456$calendar\u0027,\u0027@@\u0027)","clientStateFieldID":"123456_calendar_ClientState","enabled":true,"monthYearNavigationSettings":["Today","OK","Cancel","Date is out of range.","False"],"skin":"Default","specialDaysArray":[],"stylesHash":{DayStyle: ["", ""],CalendarTableStyle: ["", "rcMainTable"],OtherMonthDayStyle: ["", "rcOtherMonth"],TitleStyle: ["", ""],SelectedDayStyle: ["", "rcSelected"],SelectorStyle: ["", ""],DisabledDayStyle: ["", "rcDisabled"],OutOfRangeDayStyle: ["", "rcOutOfRange"],WeekendDayStyle: ["", "rcWeekend"],DayOverStyle: ["", "rcHover"],FastNavigationStyle: ["", "RadCalendarMonthView RadCalendarMonthView_Default"],ViewSelectorStyle: ["", "rcViewSel"]},"useColumnHeadersAsSelectors":false,"useRowHeadersAsSelectors":false}, null, null, $get("123456_calendar"));

    Copy this below in Visual Studio.  you will see the error in studio expected : and other errors
    <script type="text/javascript">
    //<![CDATA[
    DateTimePicker.initialise();Sys.Application.initialize();
    Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadDateInput, {"_enableOldBoxModel":false,"_focused":false,"_originalValue":"","_postBackEventReferenceScript":"__doPostBack(\u0027123456\u0027,\u0027\u0027)","_shouldResetWidthInPixels":true,"clientStateFieldID":"123456_dateInput_ClientState","dateFormat":"M/d/yyyy h:mm tt","dateFormatInfo":{"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"AMDesignator":"AM","PMDesignator":"PM","DateSeparator":"/","TimeSeparator":":","FirstDayOfWeek":0,"DateSlots":{"Month":0,"Year":2,"Day":1},"ShortYearCenturyEnd":2029,"TimeInputOnly":false},"displayDateFormat":"M/d/yyyy h:mm tt","enabled":true,"incrementSettings":{InterceptArrowKeys:true,InterceptMouseWheel:true,Step:1},"styles":{HoveredStyle: ["width:100%;", "riTextBox riHover"],InvalidStyle: ["width:100%;", "riTextBox riError"],DisabledStyle: ["width:100%;", "riTextBox riDisabled"],FocusedStyle: ["width:100%;", "riTextBox riFocused"],EmptyMessageStyle: ["width:100%;", "riTextBox riEmpty"],ReadOnlyStyle: ["width:100%;", "riTextBox riRead"],EnabledStyle: ["width:100%;", "riTextBox riEnabled"]}}, null, null, $get("123456_dateInput"));
    });
    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":{123456_calendar_Top : [[2009,9,1], 1]},"_calendarWeekRule":0, "_culture":"en-US","_enableViewSelector":false,"_firstDayOfWeek":7,"_postBackCall":"__doPostBack(\u0027123456$calendar\u0027,\u0027@@\u0027)","clientStateFieldID":"123456_calendar_ClientState","enabled":true,"monthYearNavigationSettings":["Today","OK","Cancel","Date is out of range.","False"],"skin":"Default","specialDaysArray":[],"stylesHash":{DayStyle: ["", ""],CalendarTableStyle: ["", "rcMainTable"],OtherMonthDayStyle: ["", "rcOtherMonth"],TitleStyle: ["", ""],SelectedDayStyle: ["", "rcSelected"],SelectorStyle: ["", ""],DisabledDayStyle: ["", "rcDisabled"],OutOfRangeDayStyle: ["", "rcOutOfRange"],WeekendDayStyle: ["", "rcWeekend"],DayOverStyle: ["", "rcHover"],FastNavigationStyle: ["", "RadCalendarMonthView RadCalendarMonthView_Default"],ViewSelectorStyle: ["", "rcViewSel"]},"useColumnHeadersAsSelectors":false,"useRowHeadersAsSelectors":false}, null, null, $get("123456_calendar"));
    });
    Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadTimeView, {"_ItemsCount":24,"_OwnerDatePickerID":"123456","_TimeOverStyleCss":"rcHover","_culture":"en-US","_renderDirection":"Horizontal","_timeFormat":"t","clientStateFieldID":"123456_timeView_ClientState","itemStyles":{TimeStyle: ["", ""],AlternatingTimeStyle: ["", ""],HeaderStyle: ["", "rcHeader"],FooterStyle: ["", "rcFooter"],TimeOverStyle: ["", "rcHover"]}}, null, null, $get("123456_timeView"));
    });
    Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadDateTimePicker, {"_PopupButtonSettings":{  ResolvedImageUrl : "", ResolvedHoverImageUrl : ""},"_TimePopupButtonSettings":{  ResolvedImageUrl : "", ResolvedHoverImageUrl : ""},"_popupControlID":"123456_popupButton","_timePopupControlID":"123456_timePopupLink","clientStateFieldID":"123456_ClientState","focusedDate":"2009-09-04-00-00-00"}, null, {"calendar":"123456_calendar","dateInput":"123456_dateInput","timeView":"123456_timeView"}, $get("123456"));
    });
    //]]>
    </script>


    This is one that works if u assign the id "qwerty"


    <script type="text/javascript">
        //<![CDATA[
        DateTimePicker.initialise(); Sys.Application.initialize();
        Sys.Application.add_init(function() {
            $create(Telerik.Web.UI.RadDateInput, { "_enableOldBoxModel": false, "_focused": false, "_originalValue": "", "_postBackEventReferenceScript": "__doPostBack(\u0027qwerty\u0027,\u0027\u0027)", "_shouldResetWidthInPixels": true, "clientStateFieldID": "qwerty_dateInput_ClientState", "dateFormat": "M/d/yyyy h:mm tt", "dateFormatInfo": { "DayNames": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], "MonthNames": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""], "AbbreviatedDayNames": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], "AbbreviatedMonthNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""], "AMDesignator": "AM", "PMDesignator": "PM", "DateSeparator": "/", "TimeSeparator": ":", "FirstDayOfWeek": 0, "DateSlots": { "Month": 0, "Year": 2, "Day": 1 }, "ShortYearCenturyEnd": 2029, "TimeInputOnly": false }, "displayDateFormat": "M/d/yyyy h:mm tt", "enabled": true, "incrementSettings": { InterceptArrowKeys: true, InterceptMouseWheel: true, Step: 1 }, "styles": { HoveredStyle: ["width:100%;", "riTextBox riHover"], InvalidStyle: ["width:100%;", "riTextBox riError"], DisabledStyle: ["width:100%;", "riTextBox riDisabled"], FocusedStyle: ["width:100%;", "riTextBox riFocused"], EmptyMessageStyle: ["width:100%;", "riTextBox riEmpty"], ReadOnlyStyle: ["width:100%;", "riTextBox riRead"], EnabledStyle: ["width:100%;", "riTextBox riEnabled"]} }, null, null, $get("qwerty_dateInput"));
        });
        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": { qwerty_calendar_Top: [[2009, 9, 1], 1] }, "_calendarWeekRule": 0, "_culture": "en-US", "_enableViewSelector": false, "_firstDayOfWeek": 7, "_postBackCall": "__doPostBack(\u0027qwerty$calendar\u0027,\u0027@@\u0027)", "clientStateFieldID": "qwerty_calendar_ClientState", "enabled": true, "monthYearNavigationSettings": ["Today", "OK", "Cancel", "Date is out of range.", "False"], "skin": "Default", "specialDaysArray": [], "stylesHash": { DayStyle: ["", ""], CalendarTableStyle: ["", "rcMainTable"], OtherMonthDayStyle: ["", "rcOtherMonth"], TitleStyle: ["", ""], SelectedDayStyle: ["", "rcSelected"], SelectorStyle: ["", ""], DisabledDayStyle: ["", "rcDisabled"], OutOfRangeDayStyle: ["", "rcOutOfRange"], WeekendDayStyle: ["", "rcWeekend"], DayOverStyle: ["", "rcHover"], FastNavigationStyle: ["", "RadCalendarMonthView RadCalendarMonthView_Default"], ViewSelectorStyle: ["", "rcViewSel"] }, "useColumnHeadersAsSelectors": false, "useRowHeadersAsSelectors": false }, null, null, $get("qwerty_calendar"));
        });
        Sys.Application.add_init(function() {
            $create(Telerik.Web.UI.RadTimeView, { "_ItemsCount": 24, "_OwnerDatePickerID": "qwerty", "_TimeOverStyleCss": "rcHover", "_culture": "en-US", "_renderDirection": "Horizontal", "_timeFormat": "t", "clientStateFieldID": "qwerty_timeView_ClientState", "itemStyles": { TimeStyle: ["", ""], AlternatingTimeStyle: ["", ""], HeaderStyle: ["", "rcHeader"], FooterStyle: ["", "rcFooter"], TimeOverStyle: ["", "rcHover"]} }, null, null, $get("qwerty_timeView"));
        });
        Sys.Application.add_init(function() {
            $create(Telerik.Web.UI.RadDateTimePicker, { "_PopupButtonSettings": { ResolvedImageUrl: "", ResolvedHoverImageUrl: "" }, "_TimePopupButtonSettings": { ResolvedImageUrl: "", ResolvedHoverImageUrl: "" }, "_popupControlID": "qwerty_popupButton", "_timePopupControlID": "qwerty_timePopupLink", "clientStateFieldID": "qwerty_ClientState", "focusedDate": "2009-09-04-00-00-00" }, null, { "calendar": "qwerty_calendar", "dateInput": "qwerty_dateInput", "timeView": "qwerty_timeView" }, $get("qwerty"));
        });
        //]]>
    </script>
  12. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 07 Sep 2009 Link to this post

    Hi rajeev,

    From the html you posted I see that the id of your RadCalendar instance is defined as follows:

    123456_calendar_Top

    In case the parameterid value is int it should be specified as:

    123456_Top

    Is it possible that these two underscores you have in the calendar id produce the jscript exception? Try removing the _calendar part from it to see what the result it.

    Best regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  13. CoolAggie
    CoolAggie avatar
    11 posts
    Member since:
    Aug 2009

    Posted 08 Sep 2009 Link to this post

    I am not adding the underscores. it is automatically added by ur code. i am just adding the parameterid.  like 1234 and
    ur code is adding the _calendar_Top to the 1234.
    if i change the id to suppose ur name  Sebastian  then it works.
    if i make the id  Sebastian12 then it also works.
    it is something in you dll that it doesn't like numbers.  I think it is in the javascript.

    This will work. i just hardcoding it.

      Dim cal2 As New Telerik.Web.UI.RadDateTimePicker
                    cal2.ID = "Sebastian "
                    ctrls.Add(cal2)

    This will also work.
      Dim cal2 As New Telerik.Web.UI.RadDateTimePicker
                    cal2.ID = "Sebastian1234"
                    ctrls.Add(cal2)

    This will not work

      Dim cal2 As New Telerik.Web.UI.RadDateTimePicker
                    cal2.ID = "123456"
                    ctrls.Add(cal2)



  14. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 09 Sep 2009 Link to this post

    Hi rajeev,

    Since I am still not able to reproduce the issue in my local tests, I would ask for a sample project from your end (attached to a standard support ticket) in order to examine it in detail and advice you further.

    Kind regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  15. Doug Beard
    Doug Beard avatar
    55 posts
    Member since:
    Sep 2009

    Posted 27 Oct 2009 Link to this post

    I have this same problem with a datetimepicker column within a radgrid, that is within a user control that is within a raddock that is within a splitter.  The IDs are getting mangled and creating all kinds of problems.  It occurs when I try to go into Edit mode on the grid.  It coincides with the IE7CacheFix problem.



  16. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 28 Oct 2009 Link to this post

    Hello Doug,

    I already responded in the support ticket you opened with regards to this subject. I am pasting the provided reply in this forum thread for further reference:

    I debugged your code and found that the error is generated on the following line:

    "_ViewsHash":{ctl00_mainContent__navControl_RadDock856fe7da-c232-4039-b1df-117d7c633c30_C_ctl00_gReminders_gdtcSharedCalendar_Top

    and the guid appended to the ids of the dynamically generated RadDock instances originates from this method:

    private RadDock CreateRadDockFromState(DockState state)

    {

        RadDock dock = new RadDock();

        dock.DockMode = DockMode.Docked;

        dock.ID = string.Format("RadDock{0}", state.UniqueName);

        dock.ApplyState(state);

        dock.Commands.Add(new DockCloseCommand());

        dock.Commands.Add(new DockExpandCollapseCommand());

        return dock;

    }


    Is there a particular reason why you concatenate guids to the docks ids? As discussed in the forum thread you took part in, the id of the date time picker instance should not include symbols like "-" as they conflict with the logic which parses the client id of the picker by underscores.  

    Please revise your code accordingly to see whether this eliminates the exception.


    Regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  17. Doug Beard
    Doug Beard avatar
    55 posts
    Member since:
    Sep 2009

    Posted 28 Oct 2009 Link to this post

    For everyone else's sake, I want to keep this thread going in parrallel to our support ticket.

    <Quote>
    The code originates from your example:
    http://demos.telerik.com/aspnet-ajax/dock/examples/myportal/defaultcs.aspx

    I must append some sort of unique name to the ID, for in this example (simulating Webparts) its possible to spawn multiple docks with contents of the same type.
    </Quote>

    I parsed the (-) dashes out of the GUID before assigning it to the ID of the dock.  More to come after testing...
  18. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 29 Oct 2009 Link to this post

    Hi,

    Yes the (-) dash should be taken out from the dock's id. One way to do this is replacing the dash with a "valid" character:

    dock.ID = Guid.NewGuid().ToString().Replace('-', 'a');


    Kind regards,
    Pero
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  19. Doug Beard
    Doug Beard avatar
    55 posts
    Member since:
    Sep 2009

    Posted 29 Oct 2009 Link to this post

    Exactly the methodolgy I utilized.  It worked fine.  Thank you very much for finding the solution.
  20. Beth Wetherbee
    Beth Wetherbee avatar
    4 posts
    Member since:
    Dec 2009

    Posted 15 Apr 2010 Link to this post

    I am getting this exact same error when I try to use an integer as the ID for a dynamically created RadDatePicker.  If I append some text to the beginning of the ID, I don't get the error. I'm using Telerik.Web.UI.dll version 2009.2.826.20.  I really want to use just integers for the ID. Please help!
Back to Top