Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding data to the grid
Message
From
30/11/2009 13:10:29
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01436965
Message ID:
01436981
Views:
40
>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;
>
>
> }

What is in the custom columns when you set it to true? I would guess they are empty. The problem would most likely seem to be around the data field you set for the custom columns. They need to match the column names you are binding to.
Tim
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform