z
Hi guys...
I'm trying to create on ContextMenuStrip for right click on a row... so far so good with the code:
public Form1()
{
InitializeComponent();
GridControl new_grid = new GridControl();
new_grid.Size = new Size(500, 500);
new_grid.MouseDown += new System.Windows.Forms.MouseEventHandler(this.new_grid_MouseDown);
this.Controls.Add(new_grid);
}
private void new_grid_MouseDown(object sender, MouseEventArgs e)
{
GridControl grid = (GridControl)sender;
if (e.Button == MouseButtons.Right)
{
if (grid.Selections.Count > 0)
{
foreach (GridRangeInfo selection in grid.Selections)
{
if (selection.IsRows)
{
this.ContextMenuStrip = row_menu;
row_menu.Show(Control.MousePosition.X, Control.MousePosition.Y);
}
}
}
}
}
Now I need to pass the gridcontrol to the item clicked event of ContextMenuStrip: private void row_menu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
How can i do that ? ?
Thanks in advance.