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