Hello all,

Im using .net 2.0 and i"m currently having issues with a ContextMenuStrip (CMS) and a DataGridView. On my form there are some input fields of which one has a CMS associated. This CMS is filled with a database query and has company names on the first level and then each company has X sub-elements. On clicking one of those elements the textbox which the CMS belongs to gets filled with a department code. This all works fine.

Now there is also a DataGridView on the form which has a column for each of the input fields mentioned before. To change to department code I wanted to use a CMS which shows on right-clicking on the cell holding the department code. So in the properties of this column I added the same CMS that I previously used for the department code textbox. The problem with this CMS is that it just shows the comany names on the first level. The companies do not have departments associated with them. I cant figure out why this happens cause the first CMS on the textbox still works like a charm.

I tried re-creating the CMS each time the Opening event is fired but this leads me to the problem that the first time I right click on the column the CMS doesnt show up. After that it works fine. However, I would prefer to know why the CMS doesnt work in the first place to implement a clean solution.


Thank you!
b3n_