I am using Windows form and C# and MySQL.
In that i add three unbound columns in Datagridview with the help of control tag witch is in Datagridview right top.
column1 is DataGridViewCheckBoxColumn. column 2 and 3 is DataGridViewTextBoxColumn.
After that i wrote code to fill the Datagrid view.
connection.Open();
DataTable dt = new DataTable();
// Create a new data adapter based on the specified query.
MySqlDataAdapter da = new MySqlDataAdapter("select admin_no,name from " + FormName + " where class_code='" + class_code + "' and division_code='" + division_code + "' and Delete_Status = 0", connection);
//SQl command builder is used to get data from database based on query
MySqlCommandBuilder cmd = new MySqlCommandBuilder(da);
//Fill data table
da.Fill(dt);
//assigning data table to Datagridview
dataGridView1.DataSource = dt;
//Resize the Datagridview column to fit the gridview columns with data in datagridview
dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
connection.Close();
In That I got

Here u see the two columns of Textbox is empty. and other two is added.
I don't want to remove the textbox. So I want to populate the data with in my textbox, not a auto generated one.,..
Please help me, to solve this problem....
Thanks, I got the value in template Textbox columns. But the Last two columns of auto generated columns are added. How to remove that.
connection.Open();
DataTable dt = new DataTable();
MySqlDataAdapter da = new MySqlDataAdapter("select admin_no,name from " + FormName + " where class_code='" + class_code + "' and division_code='" + division_code + "' and Delete_Status = 0", connection);
MySqlCommandBuilder cmd = new MySqlCommandBuilder(da);
da.Fill(dt);
dataGridView1.DataSource = dt;
dataGridView1.Columns[1].DataPropertyName = "admin_no";
dataGridView1.Columns[2].DataPropertyName = "name";
connection.Close();

Help Me again Please.
Sorry i forgot "dataGridView1.AutoGenerateColumns = false;".
Thanks I got my requirement.