RadCombox with checkboxes and ContextMenu

4 posts, 0 answers
  1. Gilbert van Veen
    Gilbert van Veen avatar
    68 posts
    Member since:
    Oct 2009

    Posted 09 Jun 2010 Link to this post

    Hi,

    I can't manage to get a context menu to work into a RadCombox which is filled with a list of checkboxes.

    When the user presses the open button then the list is shown. Now I need a contextmenu whereby the user can select or deselect all the checkboxes.

    The checkboxes etc. are working well but for some reason the contextmenu is not shown?

    Maybe some can give me hint?

    My XAML code:
    <telerikInput:RadComboBox   
                    x:Name="DayRedScheme_DayTypeId" Grid.Row="0"   
                    Grid.Column="1" Width="250" Height="25" Margin="0" HorizontalAlignment="Left" 
                    ClearSelectionButtonContent="None" Text="Selection" ClearSelectionButtonVisibility="Collapsed">  
                    <telerikInput:RadComboBox.SelectionBoxTemplate>                      
                        <DataTemplate> 
                            <TextBlock Grid.Row="1" Grid.Column="1" FontStyle="Oblique" Text="Selection"></TextBlock> 
                        </DataTemplate> 
                    </telerikInput:RadComboBox.SelectionBoxTemplate> 
                    <telerikInput:RadComboBox.ItemTemplate>                      
                        <DataTemplate x:Name="DayTypeComboBoxTemplate">  
                            <Grid Margin="0" Width="250">  
                                <Grid.ColumnDefinitions> 
                                    <ColumnDefinition Width="25"/>  
                                    <ColumnDefinition Width="150" /> 
                                    <ColumnDefinition Width="75" /> 
                                </Grid.ColumnDefinitions> 
                                <Grid.RowDefinitions> 
                                    <RowDefinition /> 
                                </Grid.RowDefinitions> 
                                <CheckBox Grid.Column="0" Name="CheckBoxDayType" IsChecked="{Binding IsChecked, Mode=TwoWay}"/>                             
                                <TextBlock Grid.Column="1" Text="{Binding Description}" HorizontalAlignment="Left" VerticalAlignment="Bottom">  
                                    <telerikNavigation:RadContextMenu.ContextMenu> 
                                        <telerikNavigation:RadContextMenu x:Name="ContextMenu" ItemClick="ContextMenuClick" Opened="ContextMenuOpened">  
                                            <telerikNavigation:RadMenuItem Header="Select all" /> 
                                            <telerikNavigation:RadMenuItem Header="Clear all" /> 
                                        </telerikNavigation:RadContextMenu> 
                                    </telerikNavigation:RadContextMenu.ContextMenu> 
                                </TextBlock> 
                                <Rectangle Grid.Column="2" RadiusX="3" RadiusY="3" Height="15" Width="25"  Stretch="Fill" Fill="{Binding Color}" HorizontalAlignment="Left" VerticalAlignment="Center"></Rectangle> 
                            </Grid> 
                        </DataTemplate> 
                    </telerikInput:RadComboBox.ItemTemplate> 
                </telerikInput:RadComboBox> 
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 14 Jun 2010 Link to this post

    Hello Gilbert,

    Do you use Silverlight 3? With Silverlight 3 you need to make the plug-in windowless in order to display RadContextMenu on right click.

    Kind regards,
    Valeri Hristov
    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.
  3. DevCraft banner
  4. Gilbert van Veen
    Gilbert van Veen avatar
    68 posts
    Member since:
    Oct 2009

    Posted 14 Jun 2010 Link to this post

    Hi,

    In my testpage I have:

    <

     

    body>

     

     

    <form id="form1" runat="server" style="height:100%">

     

     

    <div id="silverlightControlHost">

     

     

    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">

     

     

    <param name="source" value="ClientBin/GaSuite.xap"/>

     

     

    <param name="onError" value="onSilverlightError" />

     

     

    <param name="background" value="white" />

     

     

    <param name="minRuntimeVersion" value="3.0.40624.0" />

     

     

    <param name="autoUpgrade" value="true" />

     

     

    <param name="windowless" value="true" />

     

     

    <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">

     

     

    <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>

     

     

    </a>

     

     

    </object><iframe title="HistoryFrame" id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>

     

     

    </form>

     

    </

     

    body>

     

    </

     

    html>

     


  5. George
    Admin
    George avatar
    1332 posts

    Posted 17 Jun 2010 Link to this post

    Hi Gilbert van Veen,

    Thank you for contacting Telerik Support.

    The code you gave us looks fine. I built a sample application using the code you provided. Please pay attention to that the context menu will show if you click on the visible text in the textblock.

    Attached you can find this sample project. It's using Silverlight 3.

    I hope this information helps. I will be glad to assist you further. 

    Sincerely yours,
    George
    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