Link to home
Start Free TrialLog in
Avatar of jazz__man
jazz__man

asked on

Working with a DataGridView programmatically - creating and binding to a datasource in code - not working??

Hi I am trying to create a DataGridView in code, not for display purposes but as a temporary holder for exporting to excel - but when I go to export from the DataGridView it does not contain any data. Any ideas? I have checked and the business object has data but it is just not being assigned to the DataGridView.

Your help would be appreciated.

Dim dgv As New DataGridView
dgv.AutoGenerateColumns = True
dgv.DataSource = MyBusinessObject
Avatar of meetingexpectations
meetingexpectations

If you can provide code that would be helpful..

Based on the 3 lines of code, it seems you are not binding the data to the gridview :-)
ASKER CERTIFIED SOLUTION
Avatar of gamarrojgq
gamarrojgq

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jazz__man

ASKER

Thanks, thats probably the best way forward.