共用方式為


DataGridColumnCollection(DataGrid, ArrayList) 建構函式

定義

初始化 DataGridColumnCollection 類別的新執行個體。

public:
 DataGridColumnCollection(System::Web::UI::WebControls::DataGrid ^ owner, System::Collections::ArrayList ^ columns);
public DataGridColumnCollection (System.Web.UI.WebControls.DataGrid owner, System.Collections.ArrayList columns);
new System.Web.UI.WebControls.DataGridColumnCollection : System.Web.UI.WebControls.DataGrid * System.Collections.ArrayList -> System.Web.UI.WebControls.DataGridColumnCollection
Public Sub New (owner As DataGrid, columns As ArrayList)

參數

owner
DataGrid

對應這個集合的 DataGrid 控制項。

columns
ArrayList

儲存資料行集合的 ArrayList

範例

下列程式碼範例示範如何建立和初始化 類別的新實例 DataGridColumnCollection

void Page_Init(Object sender, EventArgs e)
{
   ArrayList myList = new ArrayList();
   DataGridColumnCollection myColumnCollection = new DataGridColumnCollection(ItemsGrid, myList);
}
Sub Page_Init(sender As Object, e As EventArgs)
    Dim myList As New ArrayList()
    Dim myColumnCollection As New DataGridColumnCollection(ItemsGrid, myList)
End Sub

備註

使用此建構函式來建立和初始化 類別的新實例 DataGridColumnCollection

適用於

另請參閱