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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Context menu for grid cell with focus

Thread ID:





4590 May 20,2003 10:37 AM UTC May 20,2003 12:20 PM UTC WinForms 1
Tags: GridControl
Bryan Mau
Asked On May 20, 2003 10:37 AM UTC

I need to provide a custom context menu that may be different for each cell in a grid. If the cell does not have focus this can be triggered off the MouseDown event. If it does have focus you have to do something like this. This strategy works fine for the case where each grid cell has the same context menu. If I want to have custom menu for each cell is there a preferred way to do this? I think I can simply override tb.ContextMenu for each cell. Can I count on each grid having one GridTextBoxControl control or do I need to fetch it every time a cell gets focus?

Administrator [Syncfusion]
Replied On May 20, 2003 12:20 PM UTC

Normally, there is a single GridTextBoxControl shared among all cells that have CellType "TextBox". If you use grid.Model.CellModels.Add, you can add additional textboxes, or change the the one that might already be there. But you would have to explicitly do this. In any case, another option might be to just swap the contextmenu out in CurrentCellStartEditing. The code you referenced went to some trouble to only do it once, but you could also do it as needed based on the grid.CurrentCell.RowIndex and grid.CurrentCell,ColIndex, and the currently assigned menu.


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon