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

Home Posts Topics Members FAQ

Grid Context Menu

Art
Hi,

Recently I was given a solution to a similar problem with a ListBox, but now
I need to do the same thing with a DataGrid.

I want my users to be able to right click on a row on a DataGrid and not
only get the context menu, but have the selection move to the row they've
right clicked.

Is there any way to do this?

Art
Nov 21 '05 #1
2 1192
Hello,

You might want to try this: Use DataGrid.HitTes t() in the mouseup event of
the grid to get the row number of the row right-clicked. Then pass it to
DataGrid.Select () to select that row.

HTH?

"Art" <Ar*@discussion s.microsoft.com > wrote in message
news:49******** *************** ***********@mic rosoft.com...
Hi,

Recently I was given a solution to a similar problem with a ListBox, but now
I need to do the same thing with a DataGrid.

I want my users to be able to right click on a row on a DataGrid and not
only get the context menu, but have the selection move to the row they've
right clicked.

Is there any way to do this?

Art
Nov 21 '05 #2
Art
Siva,

Thanks -- I'll give it a try.

Art

"Siva M" wrote:
Hello,

You might want to try this: Use DataGrid.HitTes t() in the mouseup event of
the grid to get the row number of the row right-clicked. Then pass it to
DataGrid.Select () to select that row.

HTH?

"Art" <Ar*@discussion s.microsoft.com > wrote in message
news:49******** *************** ***********@mic rosoft.com...
Hi,

Recently I was given a solution to a similar problem with a ListBox, but now
I need to do the same thing with a DataGrid.

I want my users to be able to right click on a row on a DataGrid and not
only get the context menu, but have the selection move to the row they've
right clicked.

Is there any way to do this?

Art

Nov 21 '05 #3

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

Similar topics

1
5968
by: Josh | last post by:
Caution, newbie approaching... I'm trying to come up with a very simple Tkinter test application that consists of a window with a drop-down menu bar at the top and a grid of colored rectangles filling the remainder of the window. Mind you, this is a contrived test application to help me understand Tkinter and Python, not an actual application yet. I've trivially subclassed Tkinter.Canvas into ColorCanvas, added a bunch of ColorCanvases...
4
3046
by: Mohit Gupta | last post by:
Hi all, Lately I have been working on an application in VB .net CF for Pocket PC device. I have a small question about Context Menu. When I try to close the window after context menu is poped up, the window does not closes until I click on the window. Below is the code. Hopefully, you can help me out.
5
5484
by: Dean L. Howen | last post by:
Dear friends, Could we determine when context menu should appear?
8
10090
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for a text box has 6 items, undo, cut, copy, paste, delete and select all. I would like to add one additional paste menu that opens a new sub menu with several optional text items that could be pasted. The items would be populated by my program but...
0
1656
by: Norbert | last post by:
Hi Can anybody help me ? I try to show popup menu when the right mouse button is clicked on ModHfGrid. I see the popup menu but when I click any option the click event of menuitem is not fired. I try with button (not ModHfGrid) and everything is ok. grid is as ModHFGrid control Private Sub grid_MouseDownEvent(ByVal sender As Object, ByVal e As
1
6333
by: goRide | last post by:
Hi, I'm looking of a way (preferred - a ready class or dll) to customize the context menu. many application has more controls inside the context menu (like textbox, sliders, checkbox, panel etc'). is there a way making this without writing my own context menu (meaning, popup form or something) ? Please don't post commercial products to this topic thanks.
117
18497
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of elements in the HTML to get everything just right. When you consider the class attribute on the DIV elements, there's not much size savings anymore for using DIV. There are other disadvantages to not using TABLE/TR/TD, such as the lack of ability...
2
5901
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more commands to the control's context menu? I'm envisioning a case where the control has a set of context menu items, and the parent form also has a set of context menu items. Thanks.
1
1226
by: Griff | last post by:
In Visual Studio, if you hover over an item, the IDE open up a context menu with an expandable sign. Clicking on this then brings up a context menu that appears as a grid. Clicking on sub items with a then open up further contextmenus etc, etc. I'd like to be able to open up a context menu in WPF that also contains a grid (ideally data-bound to a List(of myObject)) but don't know how to do this....any ideas? Thanks
0
8421
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
8844
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8742
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
8518
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
7354
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...
0
5643
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
4173
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...
1
2743
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
1734
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.