I need KeyUp event of DataGridView current cell with current cell value during customer typing (not the value after cell editing being finished)

0
0

Hi!

I need KeyUp event of DataGridView current cell with current cell value during customer typing (not the value after cell editing being finished)

Is not there simple filter row for the DataGridView, as in many other DataGrid controls ( row staiyng on the top, being able to type in column cell, and content filtered under the typed values). Your conditional filter row is fancy but heavy UI for most of the use cases.

Thank you!

 

  • You must to post comments
0
0

There are several ways. One is to attach to DataGridView.EditingControlShowing and attach to e.Control.KeyDown. You should also detach, otherwise when the editor is reused you may attach more than once. This is what I used:

private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
e.Control.KeyDown -= Control_KeyDown;
e.Control.KeyDown += Control_KeyDown;
}

In other cases you may use a custom editing control, or you can handle the CellBeginEdit/CellEndEdit events.

  • You must to post comments
0
0

Hi,

Public Class CDataGridView
Inherits Wisej.Web.DataGridView

Private Sub CDataGridView_EditingControlShowing(sender As Object, e As Wisej.Web.DataGridViewEditingControlShowingEventArgs) Handles Me.EditingControlShowing
MsgBox(Me.CurrentCell.Value)
End Sub

End Class

It does not work. Event does not fire during the typing into the grid cell.

Best regards!

Mario

  • You must to post comments
0
0

Hi,

you can achieve this with the following sample code:

private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
e.Control.KeyDown -= Control_KeyDown;
e.Control.KeyDown += Control_KeyDown;
}

Key events on the datagrid handle datagrid keys (up, down, etc). Keyevents on the editor handle the keyboard on the cell editor.

Hope that helps.

Best regards
Frank

  • You must to post comments
0
0

Thank you!

Would you please publish here the code for attaching to editor control events, as I am not familiar with this technique of the DataGridView control.

Thank you!

  • You must to post comments
0
0

Please attach a test case showing the issue. I tried to attach KeyDown to the editor control and it works fine.

The Wisej.Web.DataGridView doesn’t support frozen rows yet. But you can use any other data grid that you like with Wisej. All the other grids have very limited server integration though, but may provide added client side functionality. You can find some examples here:

https://wisej.com/blog/integration1/

It’s quite easy to drop in any other grid. The coding required is virtually identical (actually probably less) to what you’d have to code using any other system.

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.