Binding to datagridview

V

VMI

I have a datatable with 3 fields, and I want to bind each one of these
fields to one my Windows datagridview. In my case I have three datagridviews
with one column each. Is this possible? Even if the grid has one column,
when I bind the datatable with this grid, it'll display all three fields.
I'm using VS2005 v2.0 and winforms.

Any help is appreciated.

Thanks.
 
M

Marc Gravell

Set AutoGenerateColumns to false, and manage the columns yourself,
using DataPropertyName to specify the field name.

Marc
 
V

VMI

Thanks for the info. I thought this grid was like the Web Form grid where
the property could be set at design mode.

Thanks again.
 

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