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

    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;

  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1251 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">
            <TextBlock FontFamily="Baskerville Old Face"
                       Text="A" />
            <telerik:RadColorSelector />

    All the best,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top