TableRowCollection.Insert(Int32, TableRow) Method

Definition

将指定项插入到集合中的指定索引位置。Inserts a specified item in the collection at a specified index position.

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

Parameters

index
Int32

一个从零开始的索引,它指定集合中要插入 item 的位置。A zero-based index that specifies the position in the collection at which to insert item.

item
TableRow

要插入到集合的项。An item to insert into the collection.

Implements

Exceptions

index 小于 0 时引发。Raised when index is less than 0.

item 为 null 时引发。Raised when item is null.

Remarks

如果此集合 Count 等于 Capacity,则在插入新项之前,会自动增加集合容量。If Count equals Capacity for this collection, the collection capacity automatically is increased before the new item is inserted. 索引设置为等于 Count的值,以将新的收集项追加到集合。Set index equal to the value of Count, to append a new collection item to the collection.

可以调整现有收集项的索引以容纳新插入的集合项。Indices for existing collection items may be adjusted to accommodate the newly inserted collection item.

Applies to