treba mi mala pomoc.
Potrebno mi je u DataGridView upisati podatak i da pritiskom na taster Enter treba da prikaze u MessageBoxu broj reda u kom je upisan podatak i predje u sledeci red.
Napisao sam sledeci kod ali mi to ne zavrsava posao:
Code:
private void dataGridViewTabelaDolaska_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Enter && dataGridViewTabelaDolaska.CurrentCell.ColumnIndex == 5)
{
MessageBox.Show(dataGridViewTabelaDolaska.CurrentCell.RowIndex.ToString());
e.SuppressKeyPress = true;
int iColumn = dataGridViewTabelaDolaska.CurrentCell.ColumnIndex;
int iRow = dataGridViewTabelaDolaska.CurrentCell.RowIndex;
dataGridViewTabelaDolaska.CurrentCell = dataGridViewTabelaDolaska[iColumn , iRow+1];
}
}
private void dataGridViewTabelaDolaska_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Enter && dataGridViewTabelaDolaska.CurrentCell.ColumnIndex == 5)
{
MessageBox.Show(dataGridViewTabelaDolaska.CurrentCell.RowIndex.ToString());
e.SuppressKeyPress = true;
int iColumn = dataGridViewTabelaDolaska.CurrentCell.ColumnIndex;
int iRow = dataGridViewTabelaDolaska.CurrentCell.RowIndex;
dataGridViewTabelaDolaska.CurrentCell = dataGridViewTabelaDolaska[iColumn , iRow+1];
}
}
Samo da pojasnim, kada je prazna celija i kada klinem na Enter on mi lepo prikaze podatak, ali kada unesem neki tekst u celiju i kliknem na Enter to mi ne rad.
Da li neko zna kako da resim problem?