itrating over each color in colorpicker

5 posts, 0 answers
  1. Earthcaller
    Earthcaller avatar
    10 posts
    Member since:
    Sep 2011

    Posted 07 Oct 2011 Link to this post

    Hello Telerik team,

    Can you please suggest how to itrate over each color in the main Palette when it is set to "web216". What I want is I should be able to set and get color by looping over each color in the palette with the help of an index.
    eg:
    var int myColor = web216[1]
    and vice versa.

    thank you very much.
    regards.

     

  2. Earthcaller
    Earthcaller avatar
    10 posts
    Member since:
    Sep 2011

    Posted 10 Oct 2011 Link to this post

    Telerik Team!
    Could you please reply my query.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 12 Oct 2011 Link to this post

    Hi Earthcaller,

    I prepared a project for you that meets this requirement. Basically, I iterate over the visual tree of the RadCoorPicker, find the RadColorSelector and then print the names of the colors from the MainPalette in the Output of VisualStudio. Note that you first have to open the RadColorPicker  in order to load the RadColorSelector. Otherwise you won't be able to find it.  
    Please let us know if the solution satisfies you.

    Best wishes,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. Earthcaller
    Earthcaller avatar
    10 posts
    Member since:
    Sep 2011

    Posted 13 Oct 2011 Link to this post

    Thank you very much for your response.
    But the thing is can we somehow open the colorpicker and close it without being noticed by the user.
    Or can we not just create one RadColorSelector and populate it with the desired Palette programmatically
     and iterate over it?? I tried to do it but no luck.
    Any help would be highly appreciated.
    regards.
  6. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 17 Oct 2011 Link to this post

    Hi Earthcaller,

     Expanding and Collapsing the ColorPicker without being noticed is bad design. I prepared a sample for you that shows how to iterate over the MainPalette of both standard and bound one RadColorSelector. Please let us know if this is what you have tried before.

    All the best,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
UI for WPF is Visual Studio 2017 Ready