DataGridView and Binding Source

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
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.
 
Back
Top