0

I've added contextmenustrip control at the time of designing of my application. And i want to edit that contxt menu at run time. And i want to add another menu & submenu on that context menu. And i want to add handler function for that runtime created menus. Whether is it possible? If possible then provide some documentation.

thanks.

Priyanka
  • 2,802
  • 14
  • 55
  • 88
  • Thanks a bunch for wasting my time. Now that you have worked out what component you are talking about, why don't you at least spell it correctly with the correct letter case. C# is case-sensitive! It you want an example look in [MSDN](http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx). – David Heffernan Apr 24 '11 at 11:15
  • @David Heffernan: I'm so sorry for wasting your important time. I know it's my fault. Sorry for that. – Priyanka Apr 24 '11 at 11:24
  • That's OK. I've cooled off now. I just had a nice answer with links and code for ContextMenu, and then you obviously realised that wasn't what you were after. – David Heffernan Apr 24 '11 at 11:30

1 Answers1

1

I got an answer of my issue. the sample code used for solving this issue is as follows-

ToolStripMenuItem addContactToGroup = new ToolStripMenuItem();
addContactToGroup.Name = "addContactToGroupToolStripMenuItem";
addContactToGroup.Text = "Add Contact To Group";
addContactToGroup.Click += new System.EventHandler(addContactToGroup_Click);
this.contextMenuStripXtraGrid.Items.AddRange(new ToolStripItem[] { addContactToGroup });
gridControl1.ContextMenuStrip = this.contextMenuStripXtraGrid;

here this means form where contextmenustrip control is inserted.

Priyanka
  • 2,802
  • 14
  • 55
  • 88