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

itrating over each color in colorpicker

4 Answers 65 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Earthcaller
Top achievements
Rank 1
Earthcaller asked on 07 Oct 2011, 01:42 PM
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.

 

4 Answers, 1 is accepted

Sort by
0
Earthcaller
Top achievements
Rank 1
answered on 10 Oct 2011, 08:13 AM
Telerik Team!
Could you please reply my query.
0
Petar Mladenov
Telerik team
answered on 12 Oct 2011, 01:43 PM
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 >>

0
Earthcaller
Top achievements
Rank 1
answered on 13 Oct 2011, 06:03 AM
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.
0
Petar Mladenov
Telerik team
answered on 17 Oct 2011, 04:00 PM
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 >>

Tags
ColorPicker
Asked by
Earthcaller
Top achievements
Rank 1
Answers by
Earthcaller
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or