DataGrid コンストラクター
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
DataGrid クラスの新しいインスタンスを初期化します。
public:
DataGrid();
public DataGrid ();
Public Sub New ()
例
次のコード例では、新System.Windows.Forms.DataGridしいメソッドを作成し、メソッドをSetDataBinding使用してプロパティをDataSourceDataMember設定します。
' This object variable must go in the Declarations section:
Private DataGrid1 As DataGrid
Private Sub CreateDataGrid()
' Initialize a new DataGrid control.
me.Datagrid1 = New DataGrid
Dim myDataSet As DataSet = New DataSet("myDataSet")
Dim myDataTable As DataTable = New DataTable("Customers")
myDataSet.Tables.Add(myDataTable)
' Insert code to populate the DataTable with rows.
' Set the DataSource and DataMember of the DataGrid control.
DataGrid1.SetDataBinding(myDataSet, "Customers")
End Sub
注釈
新しく作成 System.Windows.Forms.DataGrid されたコントロールに値を設定するには、プロパティを DataSource 有効なソース (例: DataView、 DataSet、) に設定します DataViewManager。