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

[Solved] RadContextMenu Won't Open

2 Answers 118 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
michael Eller
Top achievements
Rank 1
michael Eller asked on 05 Feb 2010, 11:02 AM
Hello,

I am currently evaluating your silverlight controls (in vs2010).  So far so good, but I have ran into a problem I can't seem to crack:

I have a RadGridView inside a RadWindow and I am trying to open a RadContextMenu on right click of the GridViewRow.  It never opens.  I have followed the online demo and searched online for a solution to this.

My xaml looks like this:

<

 

 

telerikNavigation:RadWindow x:Name="OpportunitiesWindow" CanClose="False" Header="Opportunities" Top="100" Left="30" Width="700" Height="500">

 

 

 

<Grid>

 

 

 

<Grid.RowDefinitions>

 

 

 

<RowDefinition Height="Auto"></RowDefinition>

 

 

 

<RowDefinition Height="*"></RowDefinition>

 

 

 

<RowDefinition Height="Auto"></RowDefinition>

 

 

 

</Grid.RowDefinitions>

 

 

 

<Grid.ColumnDefinitions>

 

 

<ColumnDefinition Width="*" />

 

 

</Grid.ColumnDefinitions>

 

 

<riaControls:DomainDataSource Name="OpportunityDataSource" QueryName="GetOpportunities" AutoLoad="True" LoadSize="10">

 

 

<riaControls:DomainDataSource.DomainContext>

 

 

<web:OpportunityDomainContext />

 

 

</riaControls:DomainDataSource.DomainContext>

 

 

</riaControls:DomainDataSource>

 

 

<telerikNavigation:RadToolBar x:Name="OpportunitiesToolBar" Grid.Row="0" Grid.Column="0">

 

 

<Button Click="Button_Click" Tag="ExportXLS">

 

 

<Image Width="16" Height="16" ToolTipService.ToolTip="Export to Microsoft Excel" Source="/Curve;component/Assets/Images/excel_icon.png" />

 

 

</Button>

 

 

<telerikNavigation:RadToolBarSeparator />

 

 

<TextBox x:Name="txtSearchQuery" Width="100" />

 

 

<Button Click="Button_Click" Tag="Search">

 

 

<StackPanel Orientation="Horizontal">

 

 

<TextBlock Text="Search" ToolTipService.ToolTip="Search" />

 

 

</StackPanel>

 

 

</Button>

 

 

</telerikNavigation:RadToolBar>

 

 

<my:RadGridView Grid.Row="1" Grid.Column="0" CanUserFreezeColumns="False" Exporting="OpportunityGridView_Exporting" AutoGenerateColumns="false" Name="OpportunityGridView"

 

 

MultipleSelect="True" RowIndicatorVisibility="Collapsed"

 

 

ItemsSource="{Binding Data, ElementName=OpportunityDataSource}"

 

 

 

IsBusy="{Binding ElementName=OpportunityDataSource, Path=IsBusy}"

 

 

 

CanUserInsertRows="False"

 

 

 

CanUserDeleteRows="False" IsReadOnly="True">

 

 

<telerikNavigation:RadContextMenu.ContextMenu>

 

 

<telerikNavigation:RadContextMenu Name="RowContextMenu" Opened="RadContextMenu_Opened" ItemClick="RadContextMenu_ItemClick">

 

 

<telerikNavigation:RadContextMenu.Items>

 

 

<telerikNavigation:RadMenuItem Header="Add" />

 

 

<telerikNavigation:RadMenuItem Header="Edit" />

 

 

<telerikNavigation:RadMenuItem Header="Delete" />

 

 

</telerikNavigation:RadContextMenu.Items>

 

 

</telerikNavigation:RadContextMenu>

 

 

</telerikNavigation:RadContextMenu.ContextMenu>

 

 

 

I have also entered the following code in the RowLoaded event of my RadGridView:

 

 

Private Sub OpportunityGridView_RowLoaded(ByVal sender As Object, ByVal e As Telerik.Windows.Controls.GridView.RowLoadedEventArgs) Handles OpportunityGridView.RowLoaded

 

 

If TypeOf e.Row Is Telerik.Windows.Controls.GridView.GridViewRow Then

 

 

RadContextMenu.SetContextMenu(e.Row, RowContextMenu)

 

 

 

End If

 

 

End Sub  

 

 


Still no context menu :(
I am going to demo my app this afternoon, and this context menu is the last piece of the puzzle.

Thanks for your help.
Mike

2 Answers, 1 is accepted

Sort by
0
michael Eller
Top achievements
Rank 1
answered on 05 Feb 2010, 11:08 AM
Sorry about all the spaces in my code
0
Vlad
Telerik team
answered on 05 Feb 2010, 03:32 PM
Hi Mike,

Please try to set windowless=true for the Silverlight plug-in in your web application and let me know about the result.

All the best,
Vlad
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
GridView
Asked by
michael Eller
Top achievements
Rank 1
Answers by
michael Eller
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or