T
TN
I just don't get the BindingSource class when it is bound to a class.
Consider this code snip:
.....
Private bSource As New BindingSource()
Private dgv As New DataGridView()
Public Sub New()
InitializeComponent()
' Bind the BindingSource to the DemoCustomer type !!!!!!!!!!!!!
bSource.DataSource = GetType(DemoCustomer)
' Set up the DataGridView control.
dgv.Dock = DockStyle.Fill
Me.Controls.Add(dgv)
' Bind the DataGridView control to the BindingSource.
dgv.DataSource = bSource
End Sub
.....
Assuming "DemoCustomer" is a simple class with a few properties, how is
it storing the data. Normally I bind a datasource to an instance of a
datatable or something. Where is the list of DemoCustomer's instances
stored? I am missing something obvious here, yes? Thanks.
Consider this code snip:
.....
Private bSource As New BindingSource()
Private dgv As New DataGridView()
Public Sub New()
InitializeComponent()
' Bind the BindingSource to the DemoCustomer type !!!!!!!!!!!!!
bSource.DataSource = GetType(DemoCustomer)
' Set up the DataGridView control.
dgv.Dock = DockStyle.Fill
Me.Controls.Add(dgv)
' Bind the DataGridView control to the BindingSource.
dgv.DataSource = bSource
End Sub
.....
Assuming "DemoCustomer" is a simple class with a few properties, how is
it storing the data. Normally I bind a datasource to an instance of a
datatable or something. Where is the list of DemoCustomer's instances
stored? I am missing something obvious here, yes? Thanks.