[WinForms].I have 3 columns in a gridview - code,Qty,name.If a cell(Say Code), is in edit mode, pressing the arrow or tab keys will fire the 'CellEndEdit' event and after that,moves the selection to the next cell. I want to have different selected cell if it is an arrow key and another selected if it is tab. eg:
On Right arrow key: Code -> Qty
On Tab press: Code -> Name
The datagridview's key events(down,up,press) dont fire once the cell enters edit mode.So, how can i get the last pressed key's value when the cell is in edit mode. I have to write the code/method/function in CellEndEdit event. Can this be something like:
private void DataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
//Some calculations;
//Get the key if it is tab or arrow to decide which cell should be selected next
If((bool)OnKeyDown()==true)
then do this;
}
void OnKeyDown(KeyEventArgs e)
{
if(e.KeyValue==9)//tab key
return true;
}
please help