Dynamic style foreground non-edit combobox

13 posts, 1 answers
  1. Son
    Son avatar
    22 posts
    Member since:
    Jun 2011

    Posted 19 Sep 2011 Link to this post

    I have an application that allows user can change style in administration setup. I am using SQL 2008 to save setting data.
    How can I set dynamic style in code behind?
    E.x Foreground: #000000 or #FF0000 or # FFFFFF ,
    Please help me
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 21 Sep 2011 Link to this post

    Hi Son,

    To change the Foreground of the Items in the ComboBox you need to set this property to each one of them. As for the selected item the property should be set to the ComboBox itself.

    Hope this information helps.

    Kind regards,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Son
    Son avatar
    22 posts
    Member since:
    Jun 2011

    Posted 22 Sep 2011 Link to this post

    I still dont understand what you mean. I have many comboboxes in application with different itemsource.
    Is there a best way to apply all comboboxes by using style ? 
    I tried the style with fontsize, fontweight, fontfamily. They work properly but not for foreground property.
    Please help me with some code snippet
  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 26 Sep 2011 Link to this post

    Hello Son,

    In that case you can create dynamically a style, in its setter set the Foreground property and apply it to the ComboBoxes as ItemsContainerStyle. Attached I am sending you a sample project in which this is illustrated.

    Hope this helps.

    Greetings,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  6. Son
    Son avatar
    22 posts
    Member since:
    Jun 2011

    Posted 26 Sep 2011 Link to this post

    Hi Konstantina 
    I have read your attachment, it is the same way that I am doing on my project. With Non-Editable Combobox, the foreground property just apply for ItemContainer but not for selected item. In your example, I see the ItemContainer's foreground is purple but selectedItem is still black. I want all of them to be purple color. I haven't found the solution in this case yet.
    Please help me again
    Thanks
  7. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 29 Sep 2011 Link to this post

    Hi Son,

    In order to set a foreground color also to the selected item, you need to set the Foreground property of the ComboBox itself.

    All the best,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  8. Son
    Son avatar
    22 posts
    Member since:
    Jun 2011

    Posted 29 Sep 2011 Link to this post

    Hi Konstantina
    The Foreground property just apply for Editable-RadCombobox but not for Non-Editable RadCombobox. I am using Non-Editable RadCombobox.
    Can you please check it again
    Thanks
  9. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 30 Sep 2011 Link to this post

    Hello Son,

    Thank you for bringing this to our attention.

    A fix will be provided in the next week's internal build.
    Sorry for the caused inconvenience.

    All the best,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  10. Son
    Son avatar
    22 posts
    Member since:
    Jun 2011

    Posted 02 Oct 2011 Link to this post

    Hi Konstantina
    When you have new build. Can you please announce on this thread? And pointing me how can I apply that new build.
    Thanks
  11. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 05 Oct 2011 Link to this post

    Hello Son,

    The build will be available for download from your account on Monday. You can find more information how to upgrade the controls in this help article.

    Please let us know if you experience any difficulties along the way.

    Kind regards,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  12. Son
    Son avatar
    22 posts
    Member since:
    Jun 2011

    Posted 10 Oct 2011 Link to this post

    Hi Konstantina
    I didnt receive any internal builds in my account
    Can you please check it ?
    Thanks
  13. Answer
    Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 11 Oct 2011 Link to this post

    Hi Son,

    The internal build should be already ready for download under your account. Please log in and follow this link.

    Please let us know how did that go.

    Regards,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  14. Son
    Son avatar
    22 posts
    Member since:
    Jun 2011

    Posted 11 Oct 2011 Link to this post

    Hi Konstantina 
    I got it on today
    Thank you very much
Back to Top
DevCraft banner