TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ajeet Singh
NA
193
18.5k
How to dataGridView cursor go to next line when press Enter
Jun 20 2018 12:28 AM
//Below Code is not working and i am not able to find the errror......
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Enter)
{
int col = dataGridView1.CurrentCell.ColumnIndex;
int row = dataGridView1.CurrentCell.RowIndex;
if (col < dataGridView1.ColumnCount - 1)
{
col++;
}
else
{
col = 1;
row++;
}
if (row == dataGridView1.RowCount)
{
dataGridView1.Rows.Add();
dataGridView1.CurrentCell = dataGridView1[col, row];
e.Handled = true;
}
}
}
Reply
Answers (
1
)
How to get sql server password in C# windows
Want to Show dates in dataGridView Columns.