Click here to Skip to main content
16,010,553 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
In Data Grid View

1.I am trying to fill values in cell like A,B,C etc...ie. only one Capital Alphabate at a time.

2.When we press enter the focus moves to next row..i am trying to move it on next cell of same row instead of next row.


How to Do this both of two ???
Posted
Updated 11-Feb-11 22:30pm
v3

1 solution

Hi Yatin,

for 2 :


private void DataGridView1_KeyDown(object sender, KeyEventArgs e)
{
     if (e.KeyCode == Keys.Enter)
     {
          dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.CurrentRow.Index + 1].Cells[0];
     }
}

I hope this help.
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900