我有一个datagridview,我用SQL绑定了这个网格,我在数据网格中添加了五行,与sql中的相同,使用autogeneratecolumn = false.
。使用autogeneratecolumn = false绑定数据网格
我的代码是
string qry1 = "select modal,Spec,color,Types,reqQty from godownRequsition where gr='" + txtGr.Text + "'";
dataGridView1.DataSource = DAL.GetdataTable(qry1);
的问题是,当我运行程序,DataGrid的行无法显示数据。如果我完成datagrid中的所有列并且自动生成列为true,则显示数据..
现在我想将datagrid与自己生成的列绑定,而不是自动生成。
请分享您的代码 – Pawan
我想你必须设置数据源后使用的DataBind? –
请发布您的Aspx代码。 –