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

How do I set up a resource color on sql database to bound it to the scheduler

3 Answers 183 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Rafael
Top achievements
Rank 1
Rafael asked on 25 Jan 2016, 07:14 PM

Hi,

 

I would like to store the color resource property on a SQL database like I am doing with the resource Id and name, but I am wondering what data type should I use on the columns definition of the table in SQL. Could anyone help?

 

Thanks,

Rafael

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Jan 2016, 12:34 PM
Hello Rafael,

Thank you for writing.

You can use this column type which is suitable for your case to store resource's color. Then, when data binding RadScheduler, you can use SchedulerMapping which is responsible for mapping a single property from the data source to a property, which allows you to specify convert callback methods in order to convert values to and from the data source if needed. Additional information is available on the following link: http://docs.telerik.com/devtools/winforms/scheduler/data-binding/scheduler-mapping

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Rafael
Top achievements
Rank 1
answered on 28 Jan 2016, 02:04 PM

Hi Dess,

 Thanks for your help. One question when you say "this column type" which one do you are talking about? Can I use a direct mapping with the color property or do I have to do a convertion method?

 

Thank you very much for your help!

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Jan 2016, 03:01 PM
Hello Rafael,

Thank you for writing back. 

There is no specific column type that is the most appropriate for storing Color values. That is why you can store the colors as string values in your database (e.g. "red", "green", "blue"). In this case, it would be necessary to use the SchedulerMapping approach described in my previous post where you should convert the stored string value to Color and vice versa.

The following StackOverflow threads are quite useful about how to store Color in a database field:
http://stackoverflow.com/questions/785551/how-could-i-store-a-color-in-a-database-field
http://stackoverflow.com/questions/1406449/best-way-to-represent-a-color-in-a-sql-database
http://stackoverflow.com/questions/23820586/storing-and-getting-back-saved-color-from-sql-database-using-color-dialogbox

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Scheduler and Reminder
Asked by
Rafael
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Rafael
Top achievements
Rank 1
Share this question
or