DataGrid is populated or not
How do I found out if a datagrid is bound to any data table or not?
I want to use the datagrid.datasource property to achieve this, but I am not sure how to do it.
When the datagrid.datasource is undefined, I want to do something. So what should the if statement be like?
if ( datagrid.DataSource == ??)
Please let me know if anyone knwos this.
Thanks
QQ
Re: DataGrid is populated or not
:confused: You bind a bound control, like the datagrid, in design, not at runtime.
I am a little confused as to how you would NOT know to what it was bound.
Lets step through the process.
You have a datagrid control on your VB form. You have a connection to a database, through, presumably, an ADO data control which provides access to the database and its tables.
You want to bind your datagrid to one of those tables. Setting the datasource in the ADO data control provide you with a list of the available tables in the datasource property of the grid.
Are you getting that?