ColorPicker with Custom Color Button

6 posts, 0 answers
  1. Dmitrijs
    Dmitrijs avatar
    11 posts
    Member since:
    Jun 2012

    Posted 29 Aug 2012 Link to this post

    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! 

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 30 Aug 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Stefan Bischof
    Stefan Bischof avatar
    5 posts
    Member since:
    Aug 2009

    Posted 02 Nov 2012 Link to this post

    Hi,
    I'm also intersted in this fucntionality, was it introduced in last release?
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 02 Nov 2012 Link to this post

    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.

  6. Stefan Bischof
    Stefan Bischof avatar
    5 posts
    Member since:
    Aug 2009

    Posted 02 Nov 2012 Link to this post

    Thanks!
    How can I disable ColorModes, i need only RGB => Disable only ComboBox, not the whole ColorModesPanel(ActiveSections).
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 02 Nov 2012 Link to this post

    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.

Back to Top
UI for WPF is Visual Studio 2017 Ready