DataGridView and Binding Source

G

Guest

Hi,

When I set DataGridView's DataSource property to Binding Source,
DataGridView becomes invisible. If I comment that line, DataGridView is
visible again.

I am using another thread to get data from server and then using
control.invoke on ui thread to set DataGridView's DataSource property to data
received from server which is Binding Source object.

Any idea what could be the reason?
 
G

Guest

Sorry, invisible means it is still there and I can see Grid but it is grayed
out and it is not showing column names which are created at design time.

When I comment set datasource line, columns are shown even if data is not
there in Grid.
 
C

ClayB

Some things to check:

At design time, did you properly set the DisplayPropertyName in the
DataGridView.Columns collection so that the DisplayPropertyName picks
outs the column in your data source?

If you inspect the BindingSource at the point you are setting it to
the DataGridView's Datasource property, does it contain the
information you expect (ie, the columns you set in the
DisplayPropertyName and that the rows hold valid data)

Is the DataGridView enabled, and is it not ReadOnly at the point you
set the DataSource?

====================
Clay Burch
Syncfusion, Inc.
 

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