Open Context Menu on MouseMove over Selected Row in DataGrid

3 posts, 0 answers
  1. Nick
    Nick avatar
    17 posts
    Member since:
    Oct 2010

    Posted 08 Oct 2010 Link to this post

    Hi there,

     So there is a way to open Context menu on specific event. ( That is really useful.

    Now I want to do the same but only if control is in focus. My example:

    I have DataGrid control with it's own template. I also have DataGridRowTemplate in place. DataGridCellsPresenter have context menu. Right now I have EventName="MouseMove" I want to open context menu only if mouse move over selected row. Currently it will open context menu fo any row even if it is not selected.
                           <dataPrimitives:DataGridCellsPresenter x:Name="CellsPresenter" Grid.Column="1" dataPrimitives:DataGridFrozenGrid.IsFrozen="True">
                                   <telerik:RadContextMenu IconColumnWidth="36" ShowDelay="0:0:1" EventName="MouseMove"  >
                                       <telerik:RadMenuItem Header="Add/Edit Tag" Command="{Binding ContextMenuClick}" CommandParameter="Add/Edit" >
                                               <Image Source="/Scorecard.Common.Silverlight.Controls;component/Resources/TagAdd.png" Stretch="Fill"/>
                                       <telerik:RadMenuItem Header="Remove Tag" Command="{Binding ContextMenuClick}" CommandParameter="Remove" >
                                               <Image Source="/Scorecard.Common.Silverlight.Controls;component/Resources/TagRemove.png" Stretch="Fill"/>
  2. Nick
    Nick avatar
    17 posts
    Member since:
    Oct 2010

    Posted 13 Oct 2010 Link to this post

    any suggestions?
  3. George
    George avatar
    1332 posts

    Posted 14 Oct 2010 Link to this post

    Hello Nick,

    Unfortunately, you need a custom logic in order to accomplish this. There is no specific event that will be fired when the mouse moves over a selected element. I would suggest you to handle the MouseMove event and check is the row is selected. Then you can open the RadContextMenu.

    I hope this helps.

    All the best,
    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