473,654 Members | 3,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I handle the click event of a row in a standarddata grid ?

Hi all
How do I handle the click event of a row in a standard .net data grid on a
windows form ?

Regards
Neil
Nov 20 '05 #1
1 1035
Hi,

Private Sub DataGrid1_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles DataGrid1.Click

Dim pt As Point

Dim hti As DataGrid.HitTes tInfo

pt = DataGrid1.Point ToClient(Cursor .Position)

hti = DataGrid1.HitTe st(pt)

If hti.Type = DataGrid.HitTes tType.RowHeader Then

MessageBox.Show ("Row header")

End If

End Sub

Ken
-----------------
"neil rowe" <ne*******@blue yonder.co.uk> wrote in message
news:O%******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi all
How do I handle the click event of a row in a standard .net data grid on a
windows form ?

Regards
Neil

Nov 20 '05 #2

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

Similar topics

0
1138
by: newbie_csharp | last post by:
Hi, I have a grid with a textbox. by default grid is sorted by the first column. by typing in the textbox, grid will be searched. when user click on the second column's header, grid is sorted by it. then I'd like to search on the second column when user wants to type in the textbox. to do it I need to handle an event which happends when user clicks on the header of a column and change the sort column. I could not find this event. how can...
15
4036
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE CALLING FORM! This is very bad for me, because in my application, Form1 responds to an ENTER keypress by calling Form2. If the user closes Form2 via an ENTER, then Form1 just reopens it again, kind of trapping the user in Form2 (they can still close...
12
3736
by: Aaron Smith | last post by:
What is the best way to handle data in a multiple user environment? We have forms that will allow users to add edit and delete data from a table on SQL server. The data could be edited on multiple machines at the same time. How do you keep the dataset constantly updated with changes made to the data? I'm playing with just calling the fill method, but it seems pretty unstable at times. Especially when deleting records, they don't seem to...
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
4734
by: Nick | last post by:
Hey guys, I have 2 events on a windows forms datagrid, the mouse move as well as the double click events. What's happening is that when I double click on a row in the grid, the mouse move event gets triggered and the double click is not identified at all. Is there any way I can invoke the double click when the mouse move also exists?
1
1644
by: Roger | last post by:
Have a grid and when I edit a grid row it goes into edit mode. Once I attempt to click a button on the form; once the grid losses focus, it fires my beforerowupdate event. Runs through my code, but never fires the button click event. If I do not change anything on the grid, it does fire the button click event. Any ideas.
13
4916
by: Abhishek | last post by:
Hi, how do I pass the handle of a control to the win32 api mouse_event. so that it will create the click event on that application only even if there is any other window in front of it. I dont what to set focus. I just want the click event to happen in that window directly. Regards Abhishek
6
2251
by: Class | last post by:
Hi all, I create a gridview dynamicly because I don't know the columns in advance. I use the Templatefield to create a linkbutton. Everything fine..I have the postbackurl and it works. But now I need to do some extra stuff in the click event of the created linkbutton. I tried to assign a delegate to the linkbutton's click event but I never gets in the procedure I assign. How can I trap the click event?
0
2031
by: nraji | last post by:
hi, I have designed a web part using VS 2003 (Web control library template). I need to publish that in share point. Its not like drag and drop the things from toolbar. Every thing I need to do in code behind side. I have a button and text box Button Id: btnSearch TextBox id: txtSearch
0
8379
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
8294
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
8816
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...
1
8494
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
8596
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
7309
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
6162
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
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1597
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.