This is a migrated thread and some comments may be shown as answers.

RadCombox with checkboxes and ContextMenu

3 Answers 56 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Gilbert van Veen
Top achievements
Rank 1
Gilbert van Veen asked on 09 Jun 2010, 11:32 AM
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> 

3 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 14 Jun 2010, 08:58 AM
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.
0
Gilbert van Veen
Top achievements
Rank 1
answered on 14 Jun 2010, 10:37 AM
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>

 


0
George
Telerik team
answered on 17 Jun 2010, 01:56 PM
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
Tags
ComboBox
Asked by
Gilbert van Veen
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Gilbert van Veen
Top achievements
Rank 1
George
Telerik team
Share this question
or