DataGridViewCellCollection.Item[] 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置位于提供位置的项。 在 C# 中,此属性是类的 DataGridViewCellCollection 索引器。
重载
| 名称 | 说明 |
|---|---|
| Item[Int32] |
获取或设置位于提供的索引位置的单元格。 在 C# 中,此属性是类的 DataGridViewCellCollection 索引器。 |
| Item[String] |
获取或设置列中具有提供的名称的单元格。 在 C# 中,此属性是类的 DataGridViewCellCollection 索引器。 |
Item[Int32]
获取或设置位于提供的索引位置的单元格。 在 C# 中,此属性是类的 DataGridViewCellCollection 索引器。
public:
property System::Windows::Forms::DataGridViewCell ^ default[int] { System::Windows::Forms::DataGridViewCell ^ get(int index); void set(int index, System::Windows::Forms::DataGridViewCell ^ value); };
public System.Windows.Forms.DataGridViewCell this[int index] { get; set; }
member this.Item(int) : System.Windows.Forms.DataGridViewCell with get, set
Default Public Property Item(index As Integer) As DataGridViewCell
参数
- index
- Int32
要获取或设置的单元格的从零开始的索引。
属性值
DataGridViewCell存储在给定索引处。
例外
设置此属性时指定的值为 null.
另请参阅
适用于
Item[String]
获取或设置列中具有提供的名称的单元格。 在 C# 中,此属性是类的 DataGridViewCellCollection 索引器。
public:
property System::Windows::Forms::DataGridViewCell ^ default[System::String ^] { System::Windows::Forms::DataGridViewCell ^ get(System::String ^ columnName); void set(System::String ^ columnName, System::Windows::Forms::DataGridViewCell ^ value); };
public System.Windows.Forms.DataGridViewCell this[string columnName] { get; set; }
member this.Item(string) : System.Windows.Forms.DataGridViewCell with get, set
Default Public Property Item(columnName As String) As DataGridViewCell
参数
- columnName
- String
要在其中获取或设置单元格的列的名称。
属性值
DataGridViewCell存储在具有给定名称的列中。
例外
columnName 与控件中的任何列的名称不匹配。
设置此属性时指定的值为 null.