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

ColorPicker with Custom Color Button

5 Answers 363 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Dmitrijs
Top achievements
Rank 1
Dmitrijs asked on 29 Aug 2012, 10:22 AM
Hi,

I want implement something like this http://tv.telerik.com/watch/aspnet-ajax/custom-color-with-radcolorpicker 
My Code:
<telerik:RadColorPicker StandardPaletteVisibility="Hidden" MainPalette="Web216" Background="{Binding Path=Color, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource colorToBrushConverter}}"
                                                       SelectedColor="{Binding Path=Color, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource colorToBrushConverter}}"
                                                       Grid.Column="0" Margin="5" AutomaticColor="White" IsDropDownOpen="True" >
                                   <telerik:RadColorPicker.ContentTemplate>
                                       <DataTemplate>
                                           <TextBlock Text="">
                                           </TextBlock>
                                       </DataTemplate>
                                   </telerik:RadColorPicker.ContentTemplate>
                               </telerik:RadColorPicker>
                               <TextBlock Grid.Column="1" Text="{Binding Path=Color, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource colorToKnownNameConverter}}" Margin="5" IsEnabled="False"></TextBlock>
                           </Grid>
                       </DataTemplate>
Everything is fine. I just want to have a button "Custom Color" like in the video or something similar.

Thanks! 

5 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 30 Aug 2012, 06:36 AM
Hi Dmitrijs,

Thank you for your interest in our RadColorPicker.
We are currently working on the improvement of this control , we will add a Property AddionalContent (or something similar) and this way you will be able to place a custom Button. We will also work on providing a demo which shows how to integrate our RadColorEditor with the RadColorPicker. You can expect these for the upcoming Q3 in October.

Greetings,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Stefan Bischof
Top achievements
Rank 1
answered on 02 Nov 2012, 08:47 AM
Hi,
I'm also intersted in this fucntionality, was it introduced in last release?
0
Petar Mladenov
Telerik team
answered on 02 Nov 2012, 11:26 AM
Hi Herbert,

 Yes, this is already included in Q3 2012. Please check out our new ColorPicker First Look Demo. It is the same in our WPF suite demos.

All the best,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Stefan Bischof
Top achievements
Rank 1
answered on 02 Nov 2012, 01:16 PM
Thanks!
How can I disable ColorModes, i need only RGB => Disable only ComboBox, not the whole ColorModesPanel(ActiveSections).
0
Petar Mladenov
Telerik team
answered on 02 Nov 2012, 04:41 PM
Hello Herbert,

 Currently you can achieve this only with editing the default template of the RadColorEditor. You can remove the ComboBox (or set its visibility to Collapsed):

<Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <telerikInput:RadComboBox IsEditable="True"
                                        telerik:StyleManager.Theme="{StaticResource Theme}"
                                        IsReadOnly="True" Width="155" HorizontalAlignment="Right"
                                        Margin="12 0 0 10"
                                        ItemsSource="{Binding Source={StaticResource ColorModeCollection}}"
                                        SelectedIndex="{Binding RelativeSource={RelativeSource TemplatedParent}
Then you can get rid of the HLS, HSV, and Cmyk Grids containing the different Sliders. This way only the Rgb Template will exists in the style:
<telerikInput:RadComboBox IsEditable="True"
                                    telerik:StyleManager.Theme="{StaticResource Theme}"
                                    IsReadOnly="True" Width="155" HorizontalAlignment="Right"
                                    Margin="12 0 0 10"
                                    ItemsSource="{Binding Source={StaticResource ColorModeCollection}}"
                                    SelectedIndex="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ColorMode, Mode=TwoWay, Converter={StaticResource EnumConverter}}" />
                            <!-- RGB -->
                                                            <Grid x:Name="RgbTemplate" />
                                                            .....
                                                            <!-- HLS-->
                                                            <Grid x:Name="HlsTemplate" />
                                                             .......
                                                            <!-- Hsv-->
                                                            <Grid x:Name="HsvTemplate" />
                                                             .....
                                                             <!-- CMYK-->
                                                            <Grid x:Name="CmykTemplate" />
                                                            ....

Regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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