Click here to Skip to main content
16,009,728 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have one datagridview control this control i am edit one cell after that focus send to next cell in same row how to do it
??
Posted
Updated 16-Aug-13 20:41pm
v2

change This setting on form_load event

C#
this.dataGridView1.SelectionMode = DataGridViewSelectionMode.CellSelect;
this.dataGridView1.MultiSelect = false;


Thanks & Regard
Sham :)
 
Share this answer
 
C#
private void Form1_Load(object sender, EventArgs e)
   {
       this.dataGridView1.SelectionMode = DataGridViewSelectionMode.CellSelect;
       this.dataGridView1.MultiSelect = false;
   }

   private void dataGridView1_CellLeave(object sender, DataGridViewCellEventArgs e)
   {
       if (dataGridView1.CurrentCell.RowIndex == e.RowIndex)//i.e: next or befor cell is belong to current row
       {
           //some code...
           // accept all manupulition
       }
       else
       {
           //otherwise, reject all.
       }
   }
 
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