Click here to Skip to main content
15,908,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a datagridview with 10 Rows and 10 columns, I want when I enter some value on first cell then all cells of same column will show the same value

Pls help me on this.
Posted
Comments
Nirav Prabtani 12-Jun-14 9:21am    
what do want exactly??? i can not understand

DataGridView sports the CellEnter event. Subscribe a method to it, use its arguments (bearing row and column) to identify the cell that raised the event and act accordingly.
 
Share this answer
 
Hi TusharZoo,

I assume you have not bound your grid values to a data source?

So you could just handle GridView's CellEndEdit Event and than run whatever logic you want (Change the displayed values or the underlaying data source)

C#
dataGridView1.CellEndEdit += dataGridView1_CellEndEdit;
    ...

    void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
    {
        var cell = dataGridView1[e.ColumnIndex, e.RowIndex];
        cell.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