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));
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