C# Help Needed

Joined
Apr 29, 2008
Messages
6
Reaction score
0
BindingSource bs = new BindingSource();

BindingList<Customer> bList = new BindingList<Customer>();

IList<Customer> results = dbMan.GetCustomer();

foreach (Customer cust in results)

{

bList.Add(cust);

}
bs.DataSource = bList;

dataGridView1.DataSource = bs;

Is there a way to show the datagrid of customers with only the columns i need to show? Please help is importand!!!!!!!!
 
Joined
Apr 29, 2008
Messages
6
Reaction score
0
dataGridView1.AutoGenerateColumns = false;

dataGridView1.DataSource = customers;

DataGridViewColumn name = new DataGridViewColumn();

name.HeaderText = "Name";
name.DataPropertyName = "Cust_name";
name.CellTemplate = new DataGridViewTextBoxCell();

this.dataGridView1.Columns.Add(name);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top