DataGridViewComboBoxCell.ObjectCollection.Insert(Int32, Object) 方法

定義

將項目插入至索引中的指定索引處。

public:
 virtual void Insert(int index, System::Object ^ item);
public void Insert (int index, object item);
abstract member Insert : int * obj -> unit
override this.Insert : int * obj -> unit
Public Sub Insert (index As Integer, item As Object)

參數

index
Int32

在未排序的 DataGridViewComboBoxCell 中,要放置 item 處之以零起始的索引。

item
Object

表示要插入之項目的物件。

實作

例外狀況

itemnull

index 小於 0 或大於集合中的項目數。

儲存格的 DataSource 屬性值不為 null

儲存格位於共用資料列中。

備註

如果 Sortedfalse ,則 index 值代表插入值的位置 item 。 如果 為 Sorted true ,則會 index 忽略 ,並將 item 放在集合中,其位置是由排序次序所決定。

適用於

另請參閱