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.
Unfortunately, activation email could not send to your email. Please try again.

Context menu for grid cell with focus

Thread ID:

Created:

Updated:

Platform:

Replies:

4590 May 20,2003 06:37 AM May 20,2003 08:20 AM Windows Forms 1
loading
Tags: GridControl
Bryan Mau
Asked On May 20, 2003 06:37 AM

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 08:20 AM

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.

CONFIRMATION

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.

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.

;