Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binding data to the grid
Message
De
30/11/2009 17:23:21
 
 
À
30/11/2009 11:16:19
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
01436965
Message ID:
01436999
Vues:
40
Did you put the data field names in the data member properties of the columns?


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;


}
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform