Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > ColorPicker > clear selectedcolor

Answered clear selectedcolor

Feed from this thread
  • Aurore avatar

    Posted on Nov 30, 2011 (permalink)

    hello,

    I use a colorselector in a raddropdownbutton (on a ribbon), to select color for several objects.
    i have a framework as described bellow.

    I'd like that each time i click on "color" button, the selectedcolor is empty.
    because i need to be able to apply the same color for different objects, and sometimes user doesn't select all at one time, but select one defines a color, the selects another object and want to define same color. then he needs to change color selection, then reopen colorselector to choose right color.

    <Window x:Class="tlk_colorpicker.MainWindow"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <tlk:RadDropDownButton Content="Color"  x:Name="color">
                <tlk:RadDropDownButton.DropDownContent>
                    <tlk:RadColorSelector  SelectedColorChanged="PredefSelectedColorChanged"    NoColorVisibility="Collapsed" />
                </tlk:RadDropDownButton.DropDownContent>
            </tlk:RadDropDownButton>
             
            <Rectangle x:Name="oRect" Width="50" Height="50" Grid.Row="2"  Fill="AliceBlue" />
        </Grid>
    </Window>
    private void PredefSelectedColorChanged(object sender, EventArgs e)
            {
                oRect.Fill = new SolidColorBrush(((RadColorSelector)sender).SelectedColor);
                color.IsOpen = false;
            }

    thanks for your expertise
    Aurore

    Reply

  • Answer Petar Mladenov Petar Mladenov admin's avatar

    Posted on Dec 5, 2011 (permalink)

    Hi Aurore,

     You can edit the default Style of RadColorSelector and the Style of the RadColorPaletteViewItem. The you can attach for the MouseLeftButtonDownEvent of the Rectangle that holds the Color in the PalleteViewItem.
    This event will fire every time when you click on a color from the palette, even if it is the currently selected one.

    Kind regards,
    Petar Mladenov
    the Telerik team

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

    Reply

  • Aurore avatar

    Posted on Dec 5, 2011 (permalink)

    Can you give me an example ?

    Thanks
    Aurore

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Dec 8, 2011 (permalink)

    Hi Aurore,

     I created a project for you. Please note that both HeaderPalette and StandartPalette in the template of the ColorSelector use one and the same ItemContainerStyle. Please let us know if this satisfies you.

    All the best,
    Petar Mladenov
    the Telerik team

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

    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > ColorPicker > clear selectedcolor
Related resources for "clear selectedcolor"

WPF ColorPicker Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]