473,657 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagridview doesn't display context menu?

I have a simple test app with one form, one datagridview, and a
contextmenustri p. I've assigned the menustrip to the datagridview and
given the grid one column. There isn't any data in the grid. I never
see the context menu appear when I right click the grid. Any
suggestions?

Thanks,
Brett

Nov 3 '06 #1
5 6887
PS

"Brett Romero" <ac*****@cygen. comwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
>I have a simple test app with one form, one datagridview, and a
contextmenustri p. I've assigned the menustrip to the datagridview and
given the grid one column. There isn't any data in the grid. I never
see the context menu appear when I right click the grid. Any
suggestions?
Does the context menu have any menu items?

PS

Nov 3 '06 #2
Does the context menu have any menu items?
Yes - one, which is visible.

Nov 3 '06 #3
PS

"Brett Romero" <ac*****@cygen. comwrote in message
news:11******** **************@ h54g2000cwb.goo glegroups.com.. .
>
>Does the context menu have any menu items?

Yes - one, which is visible.
I have no idea at all then. I followed your steps exactly and it worked for
me. Start a new project and try it again.

PS

Nov 3 '06 #4
I'm don't know why the menu is not showing, but if all else fails you can
always explicitly 'Show' the menu from the RightClick event:
YourMenu.Show(S ystem.Windows.F orms.Cursor.Pos ition);
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: VB to Python converter
"Brett Romero" wrote:
I have a simple test app with one form, one datagridview, and a
contextmenustri p. I've assigned the menustrip to the datagridview and
given the grid one column. There isn't any data in the grid. I never
see the context menu appear when I right click the grid. Any
suggestions?

Thanks,
Brett

Nov 3 '06 #5
Ok, my fault all the way around. At design time, I need to add a
toolstripmenuit em to my contextmenustri p. It looked like an item was
already there at design time in it's collection. But once I clicked
Add (from clicking the collection property), I saw a child appear and
new that was my mistake.

The problem at run time is the datagridview will allow you to set
grid.contextmen u and fully intialize menu items. However, I can't get
it to work at all. This property isn't available at design
time...oddly. But if you follow the above for contextmenustri p, it
also works at runtime.

Does any one know if a datagridview's context menu property actually
works, similar to a regular datagrid.contex tmenu.

Thanks and sorry for the hassle,
Brett

Nov 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3602
by: DraguVaso | last post by:
Hi, I'm using the DataGridView in VB.NET 2.0. The DataSource is a Generic List of a custom class0: lstMyPersonnes = New List(Of clsPersonne). When I add a new clsPersonne to lstMyPersonnes, and rebind the lstMyPersonnes to my DataGridView.dataSource, it shows the new record in the DataGridView as it should be. But when I click on a cell of that row, I suddenly got this error: "Index -1
0
1967
by: DBC User | last post by:
Hi, I have a datagridview, with column header and on the lefthandside the rowselector. I would like to do the following 2 1. When the user click ONLY the row selector or inside the gridview (not in header), I would like to do display a message. 2. I have a context menu associated with the datagirdview and when user right click, I get my context menu but at the same time, I want to select the row where the user right clicked.
7
12599
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's the background for my question... Before I switched my application over to the Fx 2.0, I used a DataGrid to display my data. I would store different DataGridTableStyles (each one with a custom set of columns) in the DataGrid.TableStyles property...
9
1879
by: Coleen | last post by:
Hi All :-) I am desperately looking for some help/information on how to direct page flow. Forget what I have done - here's what I need to do: I have a large ASPX.Net - VB.Net web application (around 35-40 pages) that once the user logs in, I need to direct them to the correct page, depending on what they select from the directory. In other words...when they login, if they are a new user, a new account screen comes up and from there a...
1
4998
by: romerve | last post by:
Hello; i am having some problems trying to get a form that has a datagridview to refresh after a new record is created. I have a MDI container and menu form and add new record form; the menu form display the data using a data grid view and the add record form creates an object and passes that data to a class method which creates the record using sqlcommand. The add new record form is loaded after the user clicks on the add button on...
0
1553
by: Steve Richter | last post by:
I cant get a contextmenu to popup in the context of a datagridview. It pops up in the ListBox, and in the form itself. But not the DataGridView. How could that be? here is my code: using System; using System.ComponentModel; using System.Data; using System.Drawing;
3
5245
by: hzgt9b | last post by:
Using VS2005, VB.NET, I am developing a windows app that has a DataGridView. I want to enable the display of a context menu on this DataGridView only when a specific set of keys is also pressed (like CTRL+ALT+SHIFT). TO this point I have code that only displays the context menu while keys CTRL +ALT+SHIFT are pressed - but after the keys are released the context menu still gets displayed. Can someone tell me where the following code is...
1
1767
by: SePp | last post by:
Hello together, I have a main form which includes a Datatoolstripmenu. From one of these items I want to call a Form which includes an DataGridview. I want to use this form and datagridview as template and call It a lot of time from diffrent menu items.( But with diffrent data (views)) What is the best way to do that. My problem is to find a way to say: If this menu item is clicked load the template form with the template
3
2163
by: Tony K | last post by:
VB 2005 - Windows Vista I have a form that seems to lock up when the number of rows exceed the height of the datagridview. The following code executes when data is received through the serial port (ie. barcode scanning). It seems that everything works GREAT and processes as it was meant to be until the rows exceed the display area. I have 7 columns. The Description column is the only column with the AutoSizeMode set to Fill. The...
0
8413
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2742
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.