0
votes

The only control on the usercontrol is a datagridview, that initially should have two columns and no data.

  • When the user enters a value in a cell in the rightmost column, then a new, empty column should be added when the user hits enter or leaves this cell.

And that's it.

Can some one help me to find the right eventhandler for the datagridview (probably celledit or something), test that we are on the rightmost column, and then call

        DataTable dt = (DataTable)this.dataGridView1.DataSource;
        dt.Columns.Add("", typeof(double)); 
1
So, here your requirement is to add data to the Cells of the Datagridview right? - Sai Kalyan Kumar Akshinthala
Yes..My requirment is when user click on right most coloum , add some data and either press enter or leave that coloumn then a new coloum should genrate(add) automatically. - user437890

1 Answers

0
votes

Refer Adding new rows to the Datagridview for knowing how to add the rows. And also to get a functionality that when user enter or leave the right most column immediately a new row should add, you should enable the "Enable Adding" functionality shown in below image DataGridView Image