We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridTemplateColumn will not show ContextMenu

Thread ID:





130209 Apr 27,2017 07:11 PM UTC Apr 28,2017 12:22 PM UTC WPF 1
Tags: SfDataGrid
Andy Swanson
Asked On April 27, 2017 07:11 PM UTC

How do I get the ContextMenu to show in a SfDataGrid using a GridTemplateColumn and the grids EditTrigger is set to OnTap? If I set it to DoubleTap the menu will show. I want the same functionality setting the EditTrigger to OnTap.

Shobika Palani [Syncfusion]
Replied On April 28, 2017 12:22 PM UTC

Hi Andy, 

Thank you for contacting Syncfusion Support. We have analyzed your query. Seems you are looking to show context menu of the element inside EditTemplate. You can achieve your requirement by overriding GridCurrentCellManager as like below code snippet 

Code Example: 

this.datagrid.SelectionController = new SelectionControllerExt(this.datagrid); 
public class CurrentCellManager : GridCurrentCellManager 
        public CurrentCellManager(SfDataGrid grid) : base(grid) 
        internal  void SetSuspendAndResumepdates(Action suspendupdates, Action resumeupdates) 
            SuspendUpdates = suspendupdates; 
            ResumeUpdates = resumeupdates; 
        public override void ProcessOnTapped(MouseButtonEventArgs e, RowColumnIndex currentRowColumnIndex) 
            if (dataGrid.EditTrigger == EditTrigger.OnTap && e.ChangedButton != MouseButton.Right) 
                base.ProcessOnTapped(e, currentRowColumnIndex); 
            if (CurrentRowColumnIndex == currentRowColumnIndex) 
                if (!(this.dataGrid is DetailsViewDataGrid)) 
    public class SelectionControllerExt : GridSelectionController 
        public SelectionControllerExt(SfDataGrid dataGrid) : base(dataGrid) 
        protected override GridCurrentCellManager CreateCurrentCellManager() 
            CurrentCellManager currentcellmanager = new CurrentCellManager(DataGrid); 
            return currentcellmanager; 

Please let me know, if your requirement is different from above scenario. 

Shobika P 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon