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

Home Posts Topics Members FAQ

Datagrid - right click select and context menu

I have a context menu for a datagrid that shows up fine. I am wanting
to set it to where when a user right clicks anywhere on the grid, it
will select the row the mouse is over (if it's over one), and then
display the context menu. Any help is appreciated.

thanks

Nov 21 '05 #1
1 3045
skOOb33 wrote:
I have a context menu for a datagrid that shows up fine. I am wanting
to set it to where when a user right clicks anywhere on the grid, it
will select the row the mouse is over (if it's over one), and then
display the context menu. Any help is appreciated.

thanks


You will need to use the HitTestInfo class to determine if the DataGrid
is over a cell. If it is then you will use the DataGrid.Select command
to select the row you want. Just run those calls before you open your
context menu.

Chris
Nov 21 '05 #2

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

Similar topics

2
1943
by: Dmitry Karneyev | last post by:
Hi! I'm using DataGrid in windows form. I need to implement the following functionality: - any mouse must select a row according where mouse has been clicked - context menu must be also availiable by right mouse click Have you got any ideas? Thanks for any advice.
6
30003
by: Dan Bass | last post by:
If you look at explorer, right clicking on a file, first selects the file, then throws up the context menu relating to that selection. With a Windows ListBox control and a simple context menu, the default behaviour seems to display the context menu on the listbox, but there is no selection. Now I know that explorer's using a listview, and that the context menu acts differently if you click on open space (no selection), but can I...
3
2396
by: scott | last post by:
hi all, hope some one can help iv created a datagrid that points to a DataView. the data view takes in a DataTable. The DataTable then adds the columns using DataColumn. All fine so far. The table is set up and i can add stuff to it (text). however i had made it so that u can't change the text wtih in the table,
3
11617
by: vijaynats | last post by:
I have a treeview with a ContextMenu attached. When i click on a node, AfterSelect fires but does not fire when right clicked (the context menu pops up). (Background: I have loaded a list of disk file names onto the tree and have to open the file thru the contextmenu for editing. It opens the file whose treeview node was selected earlier using a left mouse click). Any solutions?
0
1363
by: Ben | last post by:
I have a DataGrid in where I have code in the MouseUp Event that checks the area of the Grid clicked, and highlights the entire row. Problem is, that if you the "Right-Click" on another row, it highlights that row and any subsequent rows using the "Right-Click". In essence, the Right-Click of a mouse is inadvertently turning my Grid into a Multi-Select, which I do not want. I thought about finding a way to disable Right-Clicking in...
5
17812
by: mabond | last post by:
Hi My project has a form, two list boxes (lstArchive and lstSchedule) and two buttons (btnSendArchive and btnSendSchedule) Each list box represents the content of a directory. The command buttons move the selected item out of one directory and into the other and refreshes the list boxes to reflect the change in directory contents I now want to add "context menu" functionality to the list boxes to preform
5
2111
by: wxnut | last post by:
In VB 2005 I have six seperately named picture boxes (arranged in a table layout control) in which I plot different X/Y data lines. I would like to be able to right-click on a specific picture box (say, plot #3) and select a different line color for that one plot. How can I figure out which of the six plots is the one in question when right-clicking on it? I can easily change the line color using the context menu control, but I don't...
3
5048
by: coltrane | last post by:
Can someone direct me to a reference that describes how to create a context menu for a selected row in a datagrid? I have come across many threads regarding context menus and datagrids but they all seem to be how to modify the default behavior. I've gone through a couple of books and many threads but none of these seem to discuss creating a context menu for a given row. I did come across a thread that allowed me to create a menu for the...
0
2719
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only, cannot serch by combine 3 table) Example I have the query table below, how do I make the code to seach based on the query from this: SELECT Product.ID, Product.Description, Quantity.Quantity, Quantity.SeialNo, Quantity.SupplierID,...
0
8739
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...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
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
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
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.