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

DoubleClick in DataGrid

DoubleClick in DataGrid

Hi I have a Datagrid bound to a dataset that I want to write a DoubleClick
procedure on. My problem is that the DoubleClick event is raised only when
DoubleClicking the column or row header. How is it possible to get a
DoubleClick event to occur on a row wherever it is DoubleClick. I also want,
when a cell within the row is selected, that the entire row is marked as
selected not just the actual cell.

TIRislaa

Nov 20 '05 #1
4 1772
Tor,

Cells require that you add a handler for each control in the grid and trap
that.

You can make one doubleclick method and
do for each on the controls in the grid and

AddHandler (adding your double click method (handler) ) to handle the
doubleclick event for each of these controls.

hope this isn't too confusing.
I had the same problem and this solves it.

Shane
"Tor Inge Rislaa" <to*************@rislaa.no> wrote in message
news:Eb*****************@news2.e.nsc.no...
DoubleClick in DataGrid

Hi I have a Datagrid bound to a dataset that I want to write a DoubleClick
procedure on. My problem is that the DoubleClick event is raised only when
DoubleClicking the column or row header. How is it possible to get a
DoubleClick event to occur on a row wherever it is DoubleClick. I also want, when a cell within the row is selected, that the entire row is marked as
selected not just the actual cell.

TIRislaa

Nov 20 '05 #2
Do you have an example code for a DataGrid

TIRislaa

"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> skrev i melding
news:Oi*************@tk2msftngp13.phx.gbl...
Tor,

Cells require that you add a handler for each control in the grid and trap
that.

You can make one doubleclick method and
do for each on the controls in the grid and

AddHandler (adding your double click method (handler) ) to handle the
doubleclick event for each of these controls.

hope this isn't too confusing.
I had the same problem and this solves it.

Shane
"Tor Inge Rislaa" <to*************@rislaa.no> wrote in message
news:Eb*****************@news2.e.nsc.no...
DoubleClick in DataGrid

Hi I have a Datagrid bound to a dataset that I want to write a DoubleClick procedure on. My problem is that the DoubleClick event is raised only when DoubleClicking the column or row header. How is it possible to get a
DoubleClick event to occur on a row wherever it is DoubleClick. I also

want,
when a cell within the row is selected, that the entire row is marked as
selected not just the actual cell.

TIRislaa


Nov 20 '05 #3
I use this to trap some function keys.

Private Sub SetGridControlKeydownHandlers()
Dim c As Control
For Each c In grdMyGridName.Controls
AddHandler c.KeyDown, AddressOf HandleFunctionKeys
Next
End Sub

Private Sub HandleFunctionKeys(ByVal Sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs)
'handle form hotkeys F6,F7,F8,F9
If e.KeyCode = Keys.F6 Then
e.Handled = True
'do something
ElseIf e.KeyCode = Keys.F7 Then
e.Handled = True
'do something
ElseIf e.KeyCode = Keys.F8 Then
e.Handled = True
'do something
ElseIf e.KeyCode = Keys.F9 Then
e.Handled = True
'do something
End If
End Sub

call SetGridControlKeydownHandlers()
everytime you refresh the grid data.

Hope this helps you.

Shane

"Tor Inge Rislaa" <to************@rislaa.no> wrote in message
news:m8*****************@news4.e.nsc.no...
Do you have an example code for a DataGrid

TIRislaa

"SStory" <Th*******@TAKEOUTTHISSPAMBUSTERsofthome.net> skrev i melding
news:Oi*************@tk2msftngp13.phx.gbl...
Tor,

Cells require that you add a handler for each control in the grid and trap
that.

You can make one doubleclick method and
do for each on the controls in the grid and

AddHandler (adding your double click method (handler) ) to handle the
doubleclick event for each of these controls.

hope this isn't too confusing.
I had the same problem and this solves it.

Shane
"Tor Inge Rislaa" <to*************@rislaa.no> wrote in message
news:Eb*****************@news2.e.nsc.no...
DoubleClick in DataGrid

Hi I have a Datagrid bound to a dataset that I want to write a

DoubleClick procedure on. My problem is that the DoubleClick event is raised only when DoubleClicking the column or row header. How is it possible to get a
DoubleClick event to occur on a row wherever it is DoubleClick. I also

want,
when a cell within the row is selected, that the entire row is marked as selected not just the actual cell.

TIRislaa



Nov 20 '05 #4

The following code worked for me. It highlights the cell (but not the
row) and made the doubleclick handler of my datagrid run without adding
a handler to each control.

Dim c As Control
For Each c In dgridMain.Controls
c.Enabled = False
Next

Hope this helps someone!

Tor Inge Rislaa wrote:
*DoubleClick in DataGrid

Hi I have a Datagrid bound to a dataset that I want to write a
DoubleClick
procedure on. My problem is that the DoubleClick event is raised only
when
DoubleClicking the column or row header. How is it possible to get a
DoubleClick event to occur on a row wherever it is DoubleClick. I
also want,
when a cell within the row is selected, that the entire row is marked
as
selected not just the actual cell.

TIRislaa *


--
Banmere
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message281664.html

Nov 21 '05 #5

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

Similar topics

2
by: JoeHenrich | last post by:
I am using VS.NET 2003 and am having an interesting issue with a Listbox control. Essentially, I have a form with a listbox on it. In the listbox doubleclick event I would like to do some...
0
by: Koo Min | last post by:
Hello, I've added drag-and-drop feature to a windows forms label control which is contained in a panel. And I added a doubleclick event handler to the drag-and-drop-abled label, but doubleclick...
5
by: David Lozzi | last post by:
Hey All, I have a listbox that I would like to fire an event on doubleclick. the onDoubleClick property of the listbox isnt available be default, and I know it will work with Javascript, but how...
2
by: Jan Nielsen | last post by:
Hi I have a form with some comboboxes My problem is that they don't react on my doubleclick event. I doubleclick in the textbox part of the combo. And nothing happens. They react on...
1
by: Duke | last post by:
Trying to learn vb.net & am frustrated. I've got data in a grid. Want user to be able to double- click on a row and see a new form with additional detail for that row. Works fine, so long as...
2
by: Rolf Falnes | last post by:
Hi. Does anyone know how to trigger the doubleclick mouse event in a datagrid cell (DatagridTextbox )? Regards, Rolf Falnes Datapartner AS
3
by: active | last post by:
DoubleClick seems to work OK with a ListBox. However, with a ListView I never get the event fired. I looked at both the LIstBox and ListView events and neither lists the DoubleClick??? But...
3
by: C Glenn | last post by:
I would like one DoubleClick event handler to handle all double clicks throughout a DataGrid. I've assigned a DoubleClick event handler to the DataGrid and it works nifty-spiffy so long as I click...
2
by: Looch | last post by:
Hi All, Am just getting into handlers at the moment and had a question. How would I write the code (the 'public void example handles cell doubleclick...) for a method to handle a double click in...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
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,...
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...
0
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...
0
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...
0
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...
0
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...

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.