Hi fs - new to w7,
As far as I know, there is no direct way to auto generate the column names, but we can set the column names programmatically before we do something with the DataGridView. This is a code snippet:
private void Form1_Load(object sender, EventArgs e)
{
//Set the Name to DataPropertyName progrommatically.
foreach (DataGridViewColumn col in this.dataGridView1.Columns)
{
col.Name = col.DataPropertyName;
}
}
Let me know if this helps or not.
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.