【发布时间】:2020-08-24 21:48:56
【问题描述】:
我使用了devexpress gridControl,如何通过代码或默认值填充gridControl中的第一行,然后通过数据表填充其他行?或者如何将数据添加到特定行。我尝试代码,但新行转到最后一个网格控件。 看到这个链接:https://c.top4top.io/p_1697xbv9x1.png
string sql = "select sup_action_date , sup_action_code , from Suppliers_Action where supplier_id = " + txt_suppler_id.Text + " Order by sup_action_date";
SqlDataAdapter da = new SqlDataAdapter(sql, DB.conn);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[0];
BindingSource dtbinding = new BindingSource();
dtbinding.DataSource = dt;
gridcontroltest.DataSource = dtbinding;
gridviewtest.AddNewRow();
gridviewtest.SetRowCellValue(GridControl.NewItemRowHandle, "Column Name", "test");
【问题讨论】:
标签: gridcontrol