473,395 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 3007
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
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...
6
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,...
3
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. ...
3
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...
0
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...
5
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...
5
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...
3
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...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...

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.