Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
column 1 column 2
8 then 8
9 9
10 10
Posted
Comments
Mohammad Reza Valadkhani 8-Feb-15 9:38am    
improve your question! describe your problem in details not in title!

1 solution

Just write code in datagridview_cellvaluechanged event like below . And after entering value click in any cell except that cell in which you have just entered text or value then you will see that the same value is in the other column in the corresponding row


C#
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{

        if (e.ColumnIndex == 0 && e.RowIndex>-1)
        {
            dataGridView1[e.ColumnIndex + 1, e.RowIndex].Value = dataGridView1[e.ColumnIndex, e.RowIndex].Value;

        }

}
 
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