Color Picker in Context Menu

9 posts, 0 answers
  1. Dhileep Kumar Sampath
    Dhileep Kumar Sampath avatar
    35 posts
    Member since:
    Oct 2009

    Posted 10 Nov 2009 Link to this post

    Hi All,
            I am having a gridview in my page and need to assign context menu for first few rows. I am setting this in code behind during RowLoaded event for the gridview. I added a menu item like "Change Row Color" and need to show a color picker as sub menu item when user click on the menu item. Do you have any suggestion or sample for this?

    Thanks,
    Dhileep
  2. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 12 Nov 2009 Link to this post

    Hello Dhileep Kumar Sampath,

    We do not have the exact example in our online demos. However you can take a look at the following more complex example:
    http://demos.telerik.com/silverlight/#RibbonBar/MSOffice
    You can also take a look at the online examples of RadColorPicker:
    http://demos.telerik.com/silverlight/#ColorPicker/FirstLook

    I hope that this will be helpfull. Please let us know if you need some more help or have any other questions.

    Regards,
    Boryana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Dhileep Kumar Sampath
    Dhileep Kumar Sampath avatar
    35 posts
    Member since:
    Oct 2009

    Posted 22 Nov 2009 Link to this post

    Hi Boryana,
               Thanks for your information. I did most part of it except that when i add the RadColorSelector control in the menu item, the control comes as a submenu item with a icon strip in the left and border on the other 3 sides (hope u get the picture) . I just want the colorselector control and not the border and icon strip. Is there a way to do this?

    Thanks,
    Dhileep
  5. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 24 Nov 2009 Link to this post

    Hello Dhileep Kumar Sampath,

    You forgot to attach the sample picture.
    Please find attached a sample project that shows how to place a RadColorSelector control in the header of RadMenuItem.
    I hope that the sample project will help you. If not please attached the sample picture so that we could be able to prepare the exact project for you.

    Greetings,
    Boryana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Dhileep Kumar Sampath
    Dhileep Kumar Sampath avatar
    35 posts
    Member since:
    Oct 2009

    Posted 24 Nov 2009 Link to this post

    Hi Boryana,
           Thanks for looking into this issue and sending me a sample project. I have edited your mainpage.xaml in your sample to get the colorpicker as submenu item. The code is:

    <UserControl x:Class="ColorPickerInMenu.MainPage" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                 xmlns:input="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" 
                 xmlns:navigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
        mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
      <Grid x:Name="LayoutRoot"
            <navigation:RadMenu Height="450" Width="200" Orientation="Vertical"
                <navigation:RadMenuItem Header="item1"
                    <navigation:RadMenuItem Header="item12"/> 
                    <navigation:RadMenuItem Header="item13"/> 
                </navigation:RadMenuItem> 
                <navigation:RadMenuItem Header="item2"/> 
                <navigation:RadMenuItem Header="item4"
                <navigation:RadMenuItem > 
                    <navigation:RadMenuItem.Header> 
                       <input:RadColorSelector/> 
                   </navigation:RadMenuItem.Header> 
                </navigation:RadMenuItem> 
                    </navigation:RadMenuItem> 
            </navigation:RadMenu> 
        </Grid> 
    </UserControl> 

    I have attached the picture of this page. If you notice the picture, there is background given to the color picker since it treats it as a sub menu item. I just want the colorpicker control to appear and not the background. Is that possible by any means?

    Thanks,
    Dhileep
  7. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 25 Nov 2009 Link to this post

    Hi Dhileep Kumar Sampath,

    Please find attached the modified sample project.
    In order to be able to fully customize the appearance of RadMenuItem you have to edit the control template and define some custom style. More information about how to edit templates in Blend and how to customize themes you can find here:
    http://www.telerik.com/help/silverlight/radcontrols-for-silverlight-expression-blend-support.html

    II hope that this will help you.
     Please let us know if you have any other questions or need some more help.

    Regards,
    Boryana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Rajesh
    Rajesh avatar
    25 posts
    Member since:
    Dec 2007

    Posted 19 Mar 2010 Link to this post

    Hi

    I was looking for displaying ColorPicker in context menu and found the sample attached in this thread.

    For menu item "item4" , color picker is shown as expected.
    In your example, you used "RadMenu" instead of RadContextMenu.


    For this "item4" menu, I need to display "Arrow" on the right side to indicate there is submenu. Also for this menu item, and all other menu items, the "Icon" area is missing.

    How one can use "RadContextMenu", so for each menu item one can have place for icon image and if submenu exists then arrow will be shown.

    Will you please provide me updated sample which displays the menus' Icon area and if there is submenu, the arrow should be displayed.

    Also, in the color picker dialog, the event for selecting the default color is not working.

    -Rajesh
  9. Rajesh
    Rajesh avatar
    25 posts
    Member since:
    Dec 2007

    Posted 19 Mar 2010 Link to this post

    Hi

    I am able to get the submenu arrow and icon place holder for menu item and using it with "RadContextMenu".

    The other two issues are still not functioning -

    1. Selecting any color closes the context menu but clicking on default color [ Top level button in color selection ] doesn't close the context menu.

    2. Is it possible to show one more button below the button pallet [ "More Colors .." ] . Clicking on this button should close the context menu or color popup window and show dialog window for color creation [ Something similar in MS Word ].

    -Rajesh
  10. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 24 Mar 2010 Link to this post

    Hi Rajesh,

    The answers of your questions are:
    1.If you have in mind the example that was posted in this forum then you mean RadColorSelector not RadColorPicker. If so you can use the following code in order to close the menu popup:
    C#:
    private void RadColorSelector_SelectedColorChanged(object sender, EventArgs e)
         {
             Popup popup = (this.selector).ParentOfType<Popup>();
             if (popup != null && popup.IsOpen)
             {
                 popup.IsOpen = false;
             }
         }
    XAML:
    <navigation:RadMenuItem x:Name="menuItem" Header="item4" Style="{StaticResource RadMenuItemStyle}">
                    <navigation:RadMenuItem  Style="{StaticResource RadMenuItemStyle}">
                        <navigation:RadMenuItem.Header>
                            <input:RadColorSelector  x:Name="selector"  SelectedColorChanged="RadColorSelector_SelectedColorChanged"/>
                        </navigation:RadMenuItem.Header>
                    </navigation:RadMenuItem >
                </navigation:RadMenuItem>

    2.This issue is already added in our to do list. Here you can see the current status and to vote for it as well :
    http://www.telerik.com/support/pits.aspx#/public/silverlight/986
    Generally if a feature or a product gets lots of votes we might change our initial plans and develop it for the next release cycle.

    I hope that this will help you.
    Please let us know if you have any other questions or need some more help.

    Best wishes,
    Bobi
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
DevCraft banner