DataGridViewRow.CreateCells 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
重置該列的儲存格。
多載
| 名稱 | Description |
|---|---|
| CreateCells(DataGridView, Object[]) |
清除現有儲存格並設定它們的範本和值。 |
| CreateCells(DataGridView) |
清除現有儲存格,並依照提供的 DataGridView 範本設定模板。 |
CreateCells(DataGridView, Object[])
清除現有儲存格並設定它們的範本和值。
public:
void CreateCells(System::Windows::Forms::DataGridView ^ dataGridView, ... cli::array <System::Object ^> ^ values);
public void CreateCells(System.Windows.Forms.DataGridView dataGridView, params object[] values);
member this.CreateCells : System.Windows.Forms.DataGridView * obj[] -> unit
Public Sub CreateCells (dataGridView As DataGridView, ParamArray values As Object())
參數
- dataGridView
- DataGridView
A DataGridView 作為儲存格樣式的範本。
- values
- Object[]
一組初始化重置儲存格的物件陣列。
例外狀況
任一參數均為 null。
備註
此方法會清除 DataGridViewCellCollection 列,並以 CellTemplate 參數每一欄 dataGridView 的屬性重新初始化。 因此,該列會從參數中採用列 dataGridView 的外觀與行為。
如果陣列中 values 元素數超過要初始化的儲存格數,這些額外的元素會被忽略。 若元素數少於所需,剩餘未匹配的儲存格將保留其預設初始值。
另請參閱
適用於
CreateCells(DataGridView)
清除現有儲存格,並依照提供的 DataGridView 範本設定模板。
public:
void CreateCells(System::Windows::Forms::DataGridView ^ dataGridView);
public void CreateCells(System.Windows.Forms.DataGridView dataGridView);
member this.CreateCells : System.Windows.Forms.DataGridView -> unit
Public Sub CreateCells (dataGridView As DataGridView)
參數
- dataGridView
- DataGridView
A DataGridView 作為儲存格樣式的範本。
例外狀況
dataGridView 為 null。
備註
此方法會清除 DataGridViewCellCollection 列,並以 CellTemplate 參數每一欄 dataGridView 的屬性重新初始化。 因此,該列會從參數中採用列 dataGridView 的外觀與行為。