AD
Administrator
Syncfusion Team
January 27, 2005 03:31 PM UTC
A control does not have its BindingContext member set until it is parented which usually happens when you add the control to its parent''s COntrols.Collection.
In your code, there is no
Me.Controls.Add(gdbc_DataBoundGrid)
so the grid does not have a parent and hence gdbc_DataBoundGrid.BindingContext is Nothing.
So, one thing you can try is to explicitly create the grid''s BindingContext before you try to use the grid in a bound manner.
gdbc_DataBoundGrid.BindingContext = new BindingContext()
(Note that Control.BindingContext is marked as an ''advanced'' property in teh VB''s editor, so you will not see it in intellisense unless you have explicitly enabled this in your VisStu properties.)
If that does not work, then you can add the grid to the forms'' Controls collection and I suspect that will make things go through OK.
gdbc_DataBoundGrid.Visible = True
Me.Controls.Add(gdbc_DataBoundGrid)