Hi,
Do you mean you want to add the columns when user adding a new row? There are some events fired when adding a new row. For example, DataGridView.RowsAdded event.
void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
if (!dataGridView1.Columns.Contains("test"))
{
DataGridViewTextBoxColumn txt = new DataGridViewTextBoxColumn();
txt.Name = "test";
txt.HeaderText = "test";
dataGridView1.Columns.Add(txt);
}
}
If I misunderstood you, or you have further questions, please feel free to tell me.
Best regards,
Ling Wang
Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.