This is a migrated thread and some comments may be shown as answers.

Saving ResourceID

4 Answers 141 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Kerry
Top achievements
Rank 1
Kerry asked on 10 Jan 2012, 07:12 AM
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

4 Answers, 1 is accepted

Sort by
0
Kerry
Top achievements
Rank 1
answered on 11 Jan 2012, 07:29 AM
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

0
Ivan Todorov
Telerik team
answered on 12 Jan 2012, 06:14 PM
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).

0
nc
Top achievements
Rank 1
answered on 24 Jan 2012, 02:08 PM
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 :(
0
Ivan Todorov
Telerik team
answered on 27 Jan 2012, 10:31 AM
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).

Tags
Scheduler and Reminder
Asked by
Kerry
Top achievements
Rank 1
Answers by
Kerry
Top achievements
Rank 1
Ivan Todorov
Telerik team
nc
Top achievements
Rank 1
Share this question
or