Cancel the split button

2 posts, 0 answers
  1. Akram
    Akram avatar
    45 posts
    Member since:
    Dec 2012

    Posted 26 Dec 2012 Link to this post

    Hi 
    how can i make the color picker has only one button, so if the user press everywhere then the drop down open.

    i use this event code to do this task but i hope there is a build in functionality to do that

            private void RadColorPicker_MouseUp(object sender, MouseButtonEventArgs e)
            {
                if (e.OriginalSource is RadButton && sender is RadColorPicker)
                    (sender as RadColorPicker).IsDropDownOpen = true;
            }


    Thanks,
    Akram 
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1218 posts

    Posted 27 Dec 2012 Link to this post

    Hi Akram,

    This behavior is not supported out-of-the-box. Handling the Click event of the button of the RadColorPicker control (not the toggle button, visualizing the arrow) will do the work only when you open the pop-up (the RadColorSelector control) because when that pop-up looses focus it closes it self. Hence you will be able only to open the color selector. On MouseDown, over the button, the pop-up will loose focus and it will close it self and the logic in the handler, for the Click event over the button, will open the pop-up again.

    The better approach is to place the RadColorSelector control as an Item of a custom designed RadDropDownButton. Please try out the following snippet and let me know if it works for you:

    <telerik:RadDropDownButton Width="40" Height="25">
        <telerik:RadDropDownButton.Content>
            <TextBlock FontFamily="Baskerville Old Face"
                       FontSize="14"
                       FontStyle="Oblique"
                       FontWeight="ExtraBold"
                       Text="A" />
        </telerik:RadDropDownButton.Content>
        <telerik:RadDropDownButton.DropDownContent>
            <telerik:RadColorSelector />
        </telerik:RadDropDownButton.DropDownContent>
    </telerik:RadDropDownButton>


    All the best,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top