Saving ResourceID

5 posts, 0 answers
  1. Kerry
    Kerry avatar
    61 posts
    Member since:
    Nov 2008

    Posted 10 Jan 2012 Link to this post

    Hello,
     
    I'm using the RadScheduler (2011 Q3_2011.3.11.1116 , VS2008 Framework 3.5) within a .NET Winform application to save some data to an MSAccess DB, I get the following error as soon I press ok on the Appointment edit screen to return back the scheduler.  The ResourceID I am trying to save is defined within MSAccess as Long Integer. The dataset (.xsd) is created within the .net application shows the column defined as System.Int32.   If I change the column mappings to point to a column that defined as a string datatype everything works ok...but I need tis to work with Int datatype.

    Unable to cast object of type 'Telerik.WinControls.UI.EventId' to type 'System.IConvertible'.Couldn't store <9> in ClientID Column.  Expected type is Int32.

    Can you please direct me to where this issue may lie.

    Thanks,

    Kerry
  2. Kerry
    Kerry avatar
    61 posts
    Member since:
    Nov 2008

    Posted 11 Jan 2012 Link to this post

    In addition when I do save the resource id into a datatype defined as string when i retrieve the appointment it does not set the resource dropdown to the selected item based on the id that is saved in the database.  Is there an additional event I must trap inorder to set the resource properly.

    Thanks

    kerry

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 12 Jan 2012 Link to this post

    Hi Kerry,

    Thank you for contacting us.

    The error from your first post is usually present when the type of the scheduler property does not match the type of the mapped column in the database. This can be solved by using a ConvertCallback methods. However, I am not sure if this is necessary in your case or exactly how should the convert methods be implemented.

    The second issue also appears to be a matter of converting between data types. However I cannot provide you with any concrete directions, since I am not aware of the complete scenario and the database schema. Therefore, I would like to kindly ask you to open a new support ticket and send us a sample project and a sample database that demonstrate your scenario. This will let me investigate it and provide you with a solution.

    Looking forward to hearing from you.

    Greetings,
    Ivan Todorov
    the Telerik team

    SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

  5. nc
    nc avatar
    3 posts
    Member since:
    Jul 2011

    Posted 24 Jan 2012 Link to this post

    I just had a problem that I couldn't solve .I did EVERYTHING as you explained and I even checked it with your demo code .My problem is that the code always returns "Nothing" for this part
    Dim newChildRecords As SchedulerDataDataSet.AppointmentsDataTable = TryCast(Me.SchedulerDataDataSet.AppointmentsResources.GetChanges(DataRowState.Added), SchedulerDataDataSet.AppointmentsDataTable)
      and also for the modified . So nothing is saved to the database . The resources are filled and  displayed perfectly in the list and the relations are set as you explained . Can you help me with this ? 
    Also I tried to add a ResourceID to the table and bing it directly to the scheduler but I kept getting type conversion errors .for instance the value <4> cannot be converted to int32 . I saw found some codes in this link
    Scheduler Mapping :http://www.telerik.com/help/winforms/scheduler-data-binding-scheduler-mapping.html but again nothing about SourceID there :(
  6. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 27 Jan 2012 Link to this post

    Hi nc,

    Thank you for writing.

    I am not sure what might be causing this issue. If you send me a sample project or a code snippet that will enable me to reproduce your case locally, I will investigate it and provide you with a solution. Meanwhile you can check our help articles Data Binding Walkthrough and Codeless Data Binding. You can also check the Data Binding example in our demo application.

    Please note that you have to open a new support ticket in order to be able to attach your project.

    Let me know if you still need assistance.

    Kind regards,
    Ivan Todorov
    the Telerik team

    SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

Back to Top
UI for WinForms is Visual Studio 2017 Ready