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

4 posts, 0 answers
  1. Rafael
    Rafael avatar
    10 posts
    Member since:
    Dec 2015

    Posted 25 Jan Link to this post

    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

  2. Dess
    Admin
    Dess avatar
    1607 posts

    Posted 26 Jan Link to this post

    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 scheduler 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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Rafael
    Rafael avatar
    10 posts
    Member since:
    Dec 2015

    Posted 28 Jan in reply to Dess Link to this post

    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!

  5. Dess
    Admin
    Dess avatar
    1607 posts

    Posted 28 Jan Link to this post

    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
Back to Top