Hi Srikant S,
By default, the FillWeight property of the datagridviewcolumn is set to 100. This can only provide up to 655 columns.
If you want to impose a lower limit on the maximum number of columns, you can use a value of FillWeight greater than 1.
So you can set the FillWeight property to 1 in ColumnAdded event to get more columns.
Here is a simple code example.
private void dataGridView1_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
{
e.Column.FillWeight = 1;
}
Best Regards,
Daniel Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.