Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > When leaving datagrid cell bu pressing enter
 

When leaving datagrid cell bu pressing enter

Hi

I'm currently using the below code when a user exits the cell, i then run what code i want. But i only want to catch the event when they leave the cell by clicking tab.

Is there a way i can see when they press tab key on a datagrid cell???

private void dtgrdGLTransLines_CellEnter(object sender, DataGridViewCellEventArgs e)

{

if (dtgrdGLTransLines.Columns[e.ColumnIndex].Name == "Debit")

{

if (dtgrdGLTransLines[e.ColumnIndex, e.RowIndex].Value == null && dtgrdGLTransLines[e.ColumnIndex+1, e.RowIndex].Value != null)

{

//my code

}

}

}

thanks in advance

LuckyL  Thursday, December 21, 2006 3:34 PM

Hi,LuckyL

Youmay handle the CellLeave event.

Ye

Zhi-Xin Ye  Tuesday, January 02, 2007 10:30 AM

Hi,LuckyL

Youmay handle the CellLeave event.

Ye

Zhi-Xin Ye  Tuesday, January 02, 2007 10:30 AM

You can use google to search for other answers

Custom Search

More Threads

• data set on combobox
• VB2005 Save coordinates in array?
• IExtenderProvider for DataGridViewColumn's doesn't work
• Exception while making a cell ReadOnly
• DataGridView MultiSelect drag problem
• DataGridView Prevent Leaving Cell with ObjectDataSource on Errors
• strange problem with combobox
• Is there a way to sort with out lossing all the selected rows?
• DataGridView to SQL database in C#
• Problem With updating record using linq...