G
Greg Dunn
When I create a form using the DataForm Wizard (VS 2003), the following
lines of code get generated near the top of the
Windows Form Designer generated code region:
CType(Me.objdsDataForm,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.grdtitles,
System.ComponentModel.ISupportInitialize).BeginInit()
The corresponding EndInit() statements get generated near the bottom of the
region:
CType(Me.objdsDataForm,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.grdtitles, System.ComponentModel.ISupportInitialize).EndInit()
Can someone explain to me what these statements do? Also, since the DataSet
and DataGrid objects both implement the ISupportInitialize interface, why do
those objects need to be converted to the interface type before the
BeginInit and EndInit methods are called? Why not just call those methods
directly on the DataSet and DataGrid objects?
Thanks.
lines of code get generated near the top of the
Windows Form Designer generated code region:
CType(Me.objdsDataForm,
System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.grdtitles,
System.ComponentModel.ISupportInitialize).BeginInit()
The corresponding EndInit() statements get generated near the bottom of the
region:
CType(Me.objdsDataForm,
System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.grdtitles, System.ComponentModel.ISupportInitialize).EndInit()
Can someone explain to me what these statements do? Also, since the DataSet
and DataGrid objects both implement the ISupportInitialize interface, why do
those objects need to be converted to the interface type before the
BeginInit and EndInit methods are called? Why not just call those methods
directly on the DataSet and DataGrid objects?
Thanks.