How to catch the enter key of TestBox in datagrid

  • Thread starter Thread starter mhw
  • Start date Start date
mhw
You can capture KeyPress event. and 13 is keyChar of Enter
search MSDN for example.

Best Regards,
Vuong
Tran Xuan
 
Sorry,I ask how to catch the enter key of dataGridTextBox in DataGrid,and
you say that is TextBox.
 
One of the easiest way is create your own tablestyle and add an eventhandler
for DataGridTextBox column's TextBox properties key_up event

DataGridTableStyle dgt = new DataGridTableStyle();
dgt.MappingName = "NamesTable";

DataGridTextBoxColumn dgtbc = new DataGridTextBoxColumn();
dgtbc.MappingName = "Name";
dgtbc.HeaderText= "Name";
dgt.GridColumnStyles.Add(dgtbc);
dgt.TextBox.KeyUp+=your eventHandler goes here



myGrid.TableStyles.Add(dgt);


Dincer Uyav
 
Back
Top