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

ContextMenu => RadButton != Button

1 Answer 88 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Eugen Rata
Top achievements
Rank 1
Eugen Rata asked on 03 Jan 2010, 02:14 AM
Hi
I found a strange behavior of ContextMenu, if won't work when bound to RadButton, and works ok for simple Button. Why so?
I'm using RadButton in my app, so the application looks consistent.
here is the code that works
        <telerik:GridViewColumn Header="Misc" IsReadOnly="True"
          <telerik:GridViewColumn.CellTemplate> 
            <DataTemplate> 
              <Button Content="Misc" > 
                    <telerikNavigation:RadContextMenu.ContextMenu > 
                      <telerikNavigation:RadContextMenu EventName="Click" > 
                        <telerikNavigation:RadContextMenu.Items> 
                          <telerikNavigation:RadMenuItem Header="IF Script" /> 
                          <telerikNavigation:RadMenuItem Header="Transform Script" /> 
                        </telerikNavigation:RadContextMenu.Items> 
                      </telerikNavigation:RadContextMenu> 
                    </telerikNavigation:RadContextMenu.ContextMenu> 
                </Button> 
            </DataTemplate> 
          </telerik:GridViewColumn.CellTemplate> 
        </telerik:GridViewColumn> 
 
if you replace Button with RadButton the menu won't appear anymore on button click.
BTW, what is the other best approach to have a context menu shown on button click when using inside GridView. The above code will work but I don't like that menu is created for every row. It could be done only once, but I could not find a nice solution to show the ContextMenu under the button in grid in MVVM scenario.
Any idea?

Tx

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 05 Jan 2010, 10:06 AM
Hello Eugen Rata,

Please accept our apologies. We will fix the issue you are facing with our RadButton and RadContextMenu. It will be included in the SP2 scheduled for this month. Also you can grab some interesting ideas from Valeri's blog post, demonstrating an interesting approaches of how to use RadContextMenu and RadToggleButton..

Regards,
Kaloyan
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.
Tags
Menu
Asked by
Eugen Rata
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or