Is there a way to add a customize DatagridviewRow using c#?
Ive made a class for the rows.
class CustomizeRow: System.Windows.Forms.DataGridViewRow
{
...
}
Now i can add some of my customize row
DataGridViewColumn column = new DataGridViewTextBoxColumn();
dataGridView1.Columns.Add(column);
CustomizeRow row = new CustomizeRow();
dataGridView1.Rows.Add(row);
But how can i handle when i am using binding source to add rows like this
bs = new BindingSource();
bs.DataSource = dataSet1.Tables["Table"];
dataGridView1.DataSource = bs;
You need to use DataGridView.RowTemplate.
From the MSDN page on the RowTemplate:
So you can simply set the template row like so: