I need to build a software for billing and keeping the stock in C#.
I have started doing it.
My wish is to input the values directly to the datagridview and we need to add new product to my bill while clicking enter.
Can anyone please help me..
I am using MS VisualStudio 2010.
Sundaram SubramanianPosted Jun 14, 2017, 5:19 AM
I hope this may help you. Thanks in advance
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
e.SuppressKeyPress = true; int iColumn = dataGridView1.CurrentCell.ColumnIndex;
int iRow = dataGridView1.CurrentCell.RowIndex;
if (iColumn == dataGridView1.Columncount-1)
{
if (dataGridView1.RowCount > (iRow + 1))
{
dataGridView1.CurrentCell = dataGridView1[1, iRow + 1];
}
else
{
//focus next control
}
}
else
dataGridView1.CurrentCell = dataGridView1[iColumn + 1, iRow];
}
Fahiz KPPosted Jun 14, 2017, 5:30 AM
Fahiz KPPosted Jun 14, 2017, 4:57 AM
Sundaram SubramanianPosted Jun 14, 2017, 4:34 AM