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.
Syncfusion Feedback

Context Menu, Right-Clicked and ListBoxSelectionMode Help

Thread ID:

Created:

Updated:

Platform:

Replies:

55542 Jan 31,2007 02:08 PM Feb 2,2007 03:58 PM Windows Forms 1
loading
Tags: Grouping
James Blibo
Asked On January 31, 2007 02:08 PM

I have a ggc that behaves as a listview thru the settings below...


this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None;
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiSimple; // One;
this.gridGroupingControl1.TableOptions.ListBoxSelectionCurrentCellOptions = GridListBoxSelectionCurrentCellOptions.HideCurrentCell;

...I want to click on a row and select that row and click on the same row to unselect it. Everything works fine. I want to click anywhere in the ggc and bring up a context menu to operate on the SelectedRecords. ... so I filter out the mouse click with the settings below...

this.gridGroupingControl1.TableModel.Options.SelectCellsMouseButtonsMask = MouseButtons.Left;


However, the context menu is behaving sporadically. It would only come up when the right click occurs on a selected row. Secondly, it would not come up when I right click the same row twice.

Please help!

Administrator [Syncfusion]
Replied On February 2, 2007 03:58 PM

Hi James,

Thanks for being patience.

This can be achieved by handling the TableControlMouseDown event and accordingly showing the context menu popup on the respective co-ordinates.

In the following code snippet, the TableControlMouseDown event is handled and context menu is shown only for the RecordFieldCell
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
private void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
{
GridTableCellStyleInfo styleinfo = e.TableControl.PointToTableCellStyle(new Point(e.Inner.X, e.Inner.Y));
if(e.Inner.Button == MouseButtons.Right && styleinfo.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell)
{
// show contextmenu1
this.contextMenu1.Show(this.gridGroupingControl1, this.gridGroupingControl1.PointToClient(Control.MousePosition));
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Sample:
http://www.syncfusion.com/Support/user/uploads/ContextMenu_GGC_b6135ab.zip

Kindly let us know if you need any further assistance.
Have a nice day.

Best regards,
Madhan

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.

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

;