DataGrid 생성자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
DataGrid 클래스의 새 인스턴스를 초기화합니다.
public:
DataGrid();
public DataGrid ();
Public Sub New ()
예제
다음 코드 예제에서는 새로 System.Windows.Forms.DataGrid 만들고 메서드를 SetDataBinding 사용 하 여 설정 및 DataSource DataMember 속성입니다.
' 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
설명
To populate a newly created System.Windows.Forms.DataGrid control, set the DataSource property to a valid source, such as a DataView, DataSet, or DataViewManager.