首页 > 代码库 > Datagridview 列绑定

Datagridview 列绑定

Datagridview 列绑定

dataGridView1.Columns.Clear();            dataGridView1.Columns.Add("id", "id");            dataGridView1.Columns.Add("Dtime", "日期");            dataGridView1.Columns.Add("Product_name", "产品名称");            dataGridView1.Columns.Add("Product_code", "产品代码");            dataGridView1.Columns.Add("Product_category", "产品类别");                    dataGridView1.Columns["id"].DataPropertyName = "id";            dataGridView1.Columns["Dtime"].DataPropertyName = "Dtime";            dataGridView1.Columns["Product_name"].DataPropertyName = "Product_name";            dataGridView1.Columns["Product_code"].DataPropertyName = "Product_code";            dataGridView1.Columns["Product_category"].DataPropertyName = "Product_category";

 

Datagridview 列绑定