Click here to Skip to main content
15,906,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have gridview with 4 columns. My first column is Sr.No. and from second column i accept inputs from user.

Now, when i press TAB key, focus moves Nexe Cell, but i need to skip column 1

how to do that ?

Appreciate for solution.
Posted

Then make the textbox(S.No column) Disable or Readonly or remove the TabIndex

FYI Set Focus to TextBox in GridView (edit mode)[^]
 
Share this answer
 
Comments
shreya1987 6-Aug-11 8:07am    
thankful, solved (actually i made it disabled)
thatraja 6-Aug-11 8:11am    
Hey you....from the GIT :)
Welcome.
On CellEnter event of GridView, you can check you condition e.g. if it is first column than set GridView.CurrentCell to you desired cell.

C#
private void dataGridView1_CellEnter(object sender,
    DataGridViewCellEventArgs e)
{
   if (e.ColumnIndex==1)
        dataGridView1.CurrentCell= dataGridView1[e.ColumnIndex+1, e.RowIndex]
}
 
Share this answer
 
Comments
shreya1987 6-Aug-11 8:08am    
thankful.

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