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?

--
Thanks,
Mahesh

RE: DataGridView and Binding Source by MaheshNimbalkar

MaheshNimbalkar
Sun Jul 29 20:06:08 CDT 2007

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.

--
Thanks,
Mahesh



"Mahesh Nimbalkar" wrote:

> 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?
>
> --
> Thanks,
> Mahesh
>

Re: DataGridView and Binding Source by ClayB

ClayB
Mon Jul 30 03:44:44 CDT 2007

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.