473,385 Members | 1,813 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,385 software developers and data experts.

contextMenu & Datagrid

MDB
Hello All,

I have a datagrid with multiple rows and columns When a user taps a column
I update the quantity by one and then when they tap and hold, I display a
context menu with Subtract and Quantity displayed. Everything works fine
however, I can not figure out how to tell which of the datagrids
cells(row/column) is selected where the context menu is displayed. Can
anyone help? I have tried DataGrid.CurrentCell however, if the cell is not
highlighted/selected, it doesn't work.

Thanks In Advance
Nov 16 '05 #1
1 2012
MDB,

What you want to do is get the coordinates for where the button press
took place. Since I assume you are handling the mouse down event, you
should have no problem finding out these coordinates. Once you do that, you
can pass them through to the HitTest method on the DataGrid, and it will let
you know where on the grid the coordinate applies to (including the row and
column number of the cell, if applicable).

Hope this helps.

"MDB" <nospam> wrote in message
news:Ow**************@TK2MSFTNGP14.phx.gbl...
Hello All,

I have a datagrid with multiple rows and columns When a user taps a
column I update the quantity by one and then when they tap and hold, I
display a context menu with Subtract and Quantity displayed. Everything
works fine however, I can not figure out how to tell which of the
datagrids cells(row/column) is selected where the context menu is
displayed. Can anyone help? I have tried DataGrid.CurrentCell however,
if the cell is not highlighted/selected, it doesn't work.

Thanks In Advance

Nov 16 '05 #2

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

Similar topics

1
by: Peter Zentner | last post by:
Hi all, if I assign a context menu to a treeview and popup the contextmenu with the APP-key the context menu appears in the center of the treeview control and not at the selected treenode. Is...
2
by: PeterZ | last post by:
Hi, I have a single context menu assigned to 10 controls (DataGrids) on a form. In the context menu item click event I need to determine which control (DataGrid) is invoking this menu item. ...
0
by: news.tpi.pl | last post by:
Could you help me? 1. How to easy change DataGrid row color? 2. I have many PictureBoxes and they are conneted with one ContextMenu and item selection is handled in one event. I don't know how...
10
by: Sender | last post by:
somebody wrote the solution for this many many days ago on this newsgroup....but I lost the notes..... and everyone knows how hard it is to search on newgroups (archives).... so here I am asking...
3
by: Mika Mähönen | last post by:
Hello! I have Windows Form application containing StatusBar (sb below) and also ContextMenu for this StatusBar. StatusBar contains 2 panels, and I want to show ContextMenu only if the...
2
by: NEWBIE in ABQ | last post by:
I have a VB6 application that uses MSFLIXGRID's all ove the place to display lists. I programed a popupmenu to display when a click event occured on the gird and it displays a menu to Add, Change,...
11
by: Graham Charles | last post by:
I'm writing a control inheriting from ComboBox, and I'd like to add an entry to the ContextMenu for that combo box. I have no problem if I create an entirely new ContextMenu from scratch, but I'd...
7
by: wandii | last post by:
Hi, I am trying to show the shortcut menu on a richtextbox control by adding the contextmenu component onto the form. The richtextbox property is assigned to the contextmenu. I created my...
1
by: Darin | last post by:
I understand microsoft's change from contextmenu to contextmenustrip - the strip looks "prettier". But, since the contextmenu isn't available in the designer, it suer woul dhave been nice when...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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.