General information
Title:
Binding data to the grid
When I set autogeneratecolumns to false, my grid does not populate. When I set it to true, the grid populates with data but the table headings from SQL Server are created along side the custom columns I created. There must be a step I'm missing. Here's the code:
private void CustomerOrders_Load(object sender, EventArgs e)
{
DataSet ds = orders.GetCustomerOrders(this.CustId);
this.dataGridView1.AutoGenerateColumns = false;
DataView source = new DataView(ds.Tables[0]);
this.dataGridView1.DataSource = source;
}
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only