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. Image for the cookie policy date

How to bring up context menu while editing a cell

Hi, we want to be able to duplicate the value for a cell for rest of the row when the user clicks a context menu option. This works if the cell already has data but if they want to do it in one step - enter the value and then duplicate across they have to click enter and then click back in that cell to activate the context menu. Is there a way to get the context menu to be active while editing a cell? Thanks, Corinne

6 Replies

AD Administrator Syncfusion Team May 12, 2004 04:53 PM UTC

Here is a sample that should show context menus whether or not a cell is being edited.. It uses the grid_MouseUp event to handle all right clicks that the grid catches (which include the checkbox case), and dynamically hooks the cellcontrol_MouseUp in CurrentCellControlGotFocus and unhooks it in CurrentCellControlLostFocus. This allows us to catch the context menu for active cell controls.


CM Corinne Muir May 27, 2004 02:39 PM UTC

How can we get the inline edit mode to complete - is there a call we can make? We need to know if the input is invalid before doing anything with it. Thanks, Corinne


AD Administrator Syncfusion Team May 27, 2004 02:43 PM UTC

Try calling grid.CurrentCell.ConfirmChanges to see if that does what you need. If not, you can also try grid.CurrentCell.EndEdit. (If this is a GridDataBoundGrid, and you want to flush the changes to the data source, try also calling grid.Binder.EndEdit.)


CM Corinne Muir May 27, 2004 05:34 PM UTC

Thanks again!


CM Corinne Muir June 28, 2004 06:29 PM UTC

This sample was working fine until we click on a context menu choice that opens another dialog to set a value - the act of showing the dialog loses the focus of the current cell which causes both the dialog to be displayed and the context menu to be displayed with neither of them having focus or working. ideas? thanks, Corinne >Here is a sample that should show context menus whether or not a cell is being edited.. It uses the grid_MouseUp event to handle all right clicks that the grid catches (which include the checkbox case), and dynamically hooks the cellcontrol_MouseUp in CurrentCellControlGotFocus and unhooks it in CurrentCellControlLostFocus. This allows us to catch the context menu for active cell controls. > >


AD Administrator Syncfusion Team June 28, 2004 06:48 PM UTC

Can you modify the sample above to show the problem? I added a MenuHandler and displayed a MessageBox from it, and it seemed to do OK for me.

Loader.
Up arrow icon