splittercontrol issue
When using a splitterControl with a gridControl inside, my contextmenu is only raised when I am clicking in the top left panel (with the grid split into different panels). How do I get the other panels to quit blocking the context menu (and any other events that may be getting blocked that I am unaware of)?
v/r
Jan
v/r
Jan
SIGN IN To post a reply.
7 Replies
CI
Christopher Issac Sunder K
Syncfusion Team
October 4, 2010 01:13 PM UTC
Hi Jan,
Thank you for your interest in Syncfusion products. You could achieve the desired behavior by handling the MouseDown event. This will allow us to display contextmenu on right clicking on the grid cells by checking the e.Inner.Button property. Sample also shows how to display different context menu on different parts of the grid.
if (e.Inner.Button == System.Windows.Forms.MouseButtons.Right)
{
int row = 0;
int col = 0;
Point pt = new Point(e.Inner.X, e.Inner.Y);
e.TableControl.PointToRowCol(pt, out row, out col);
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(row, col);
if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.ColumnHeader)
{
this.ContextMenuStrip1.Show(e.TableControl, pt);
}
//Caption
else if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Caption)
{
this.ContextMenuStrip2.Show(e.TableControl, pt);
}
//RowHeader
else if (style.TableCellIdentity.ColIndex == 0)
{
this.ContextMenuStrip3.Show(e.TableControl, pt);
}
//Cell
else if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record)
{
this.ContextMenuStrip4.Show(e.TableControl, pt);
}
}
}
Sample for your reference:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GGCMenu-348734224.zip
Please let me know if this helps.
Regards,
Christo.
Thank you for your interest in Syncfusion products. You could achieve the desired behavior by handling the MouseDown event. This will allow us to display contextmenu on right clicking on the grid cells by checking the e.Inner.Button property. Sample also shows how to display different context menu on different parts of the grid.
if (e.Inner.Button == System.Windows.Forms.MouseButtons.Right)
{
int row = 0;
int col = 0;
Point pt = new Point(e.Inner.X, e.Inner.Y);
e.TableControl.PointToRowCol(pt, out row, out col);
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(row, col);
if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.ColumnHeader)
{
this.ContextMenuStrip1.Show(e.TableControl, pt);
}
//Caption
else if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Caption)
{
this.ContextMenuStrip2.Show(e.TableControl, pt);
}
//RowHeader
else if (style.TableCellIdentity.ColIndex == 0)
{
this.ContextMenuStrip3.Show(e.TableControl, pt);
}
//Cell
else if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record)
{
this.ContextMenuStrip4.Show(e.TableControl, pt);
}
}
}
Sample for your reference:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GGCMenu-348734224.zip
Please let me know if this helps.
Regards,
Christo.
AD
Administrator
Syncfusion Team
October 4, 2010 03:21 PM UTC
Did you read my post first?
1. I am using a GridControl, not a GridGroupingControl.
2. The issue relates to a GridControl hosted inside a SplitterControl.
Your example has neither a GridControl nor a SplitterControl, and the MouseEventArgs structure associated with a GridControl does not have an "Inner" property, nor a "TableControl" property.
Do you have an idea why the SplitterControl blocks the GridControl from raising a ContextMenu when right-clicking in any panel other than the top left panel of the SplitterControl?
v/r
Jan
1. I am using a GridControl, not a GridGroupingControl.
2. The issue relates to a GridControl hosted inside a SplitterControl.
Your example has neither a GridControl nor a SplitterControl, and the MouseEventArgs structure associated with a GridControl does not have an "Inner" property, nor a "TableControl" property.
Do you have an idea why the SplitterControl blocks the GridControl from raising a ContextMenu when right-clicking in any panel other than the top left panel of the SplitterControl?
v/r
Jan
JJ
Jisha Joy
Syncfusion Team
October 12, 2010 06:27 AM UTC
Hi Jan,
I regret for the inconveninece caused.
I have tested the issue in the following attached sample. The contextmenu is showing propertly on right clicking on the gridcontrols placed in the splittercontrol.
Could you please try reproducing it in the attached sample or send us the reproducing steps so that we could sort out the cause of the issue and provide you a solution?.
Kindly let me know if you have any questions.
Regards,
Jisha
GCSplitter_3cf8fbf7.zip
I regret for the inconveninece caused.
I have tested the issue in the following attached sample. The contextmenu is showing propertly on right clicking on the gridcontrols placed in the splittercontrol.
Could you please try reproducing it in the attached sample or send us the reproducing steps so that we could sort out the cause of the issue and provide you a solution?.
Kindly let me know if you have any questions.
Regards,
Jisha
GCSplitter_3cf8fbf7.zip
AD
Administrator
Syncfusion Team
October 12, 2010 04:42 PM UTC
You are not using a SplitterControl (the Syncfusion widget) in your example. You are using a SplitContainer (the Microsoft widget). See the attached example project for an illustration of the problem.
example_17c0a6a5.zip
example_17c0a6a5.zip
CI
Christopher Issac Sunder K
Syncfusion Team
October 21, 2010 04:47 PM UTC
Hi Jan,
We regret for the inconvenience and delay in getting back to you.
I am able to see the reported behavior in ContextMenuStrip when splitterControl is enabled in GridControl. The other parts of the GridControl doesn’t invoke the ContextMenuStrip because you haven’t assign the SplitterControl’s ContextMenuStrip property to ‘contextMenuStripEx1’.
Please refer the modified sample which illustrates the same.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=example-438973444.zip
Please let me know if you have any other concerns.
Regards,
Christo.
We regret for the inconvenience and delay in getting back to you.
I am able to see the reported behavior in ContextMenuStrip when splitterControl is enabled in GridControl. The other parts of the GridControl doesn’t invoke the ContextMenuStrip because you haven’t assign the SplitterControl’s ContextMenuStrip property to ‘contextMenuStripEx1’.
this.gridControl1.ContextMenuStrip = this.contextMenuStripEx1;
this.splitterControl1.ContextMenuStrip = this.contextMenuStripEx1;//set this code too
Please refer the modified sample which illustrates the same.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=example-438973444.zip
Please let me know if you have any other concerns.
Regards,
Christo.
AD
Administrator
Syncfusion Team
October 22, 2010 04:43 PM UTC
Thank you. That fixed the problem.
Is the need to assign the context menu to the splitter control in the documentation? I didn't see it. Oh, well... At least it's fixed now.
Is the need to assign the context menu to the splitter control in the documentation? I didn't see it. Oh, well... At least it's fixed now.
AA
Arulraj A
Syncfusion Team
November 2, 2010 04:18 AM UTC
Hi Jan,
Thanks for the update.
We feel happy that your problem has been solved. Please do get back to us if you have any concerns and we will be happy to help you.
Regards,
Arulraj.A
Thanks for the update.
We feel happy that your problem has been solved. Please do get back to us if you have any concerns and we will be happy to help you.
Regards,
Arulraj.A
SIGN IN To post a reply.
- 7 Replies
- 4 Participants
-
AD Administrator
- Sep 20, 2010 02:42 PM UTC
- Nov 2, 2010 04:18 AM UTC