DataGridViewRow.Cells プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridViewRow.Cells プロパティの意味・解説 

DataGridViewRow.Cells プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

行に設定されるセルコレクション取得します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public ReadOnly Property
 Cells As DataGridViewCellCollection
Dim instance As DataGridViewRow
Dim value As DataGridViewCellCollection

value = instance.Cells
public DataGridViewCellCollection Cells { get;
 }
public:
property DataGridViewCellCollection^ Cells {
    DataGridViewCellCollection^ get ();
}
/** @property */
public DataGridViewCellCollection get_Cells ()
public function get Cells
 () : DataGridViewCellCollection

プロパティ
行内セルがすべて格納された DataGridViewCellCollection。

解説解説

行にセル含まれていない場合にこのプロパティアクセスすると、CreateCellsInstance メソッド呼び出しにより、新しい空の DataGridViewCellCollection作成されます。

使用例使用例

Cells プロパティ使用して行内セルの値を設定するコード例次に示します次のコード例は、「方法 : Windows フォームの DataGridView コントロールの行を操作する」で示されている例の一部です。

' Give cheescake excellent rating.
Private Sub Button8_Click(ByVal
 sender As Object, _
    ByVal e As System.EventArgs) Handles
 Button8.Click

    UpdateStars(dataGridView.Rows(4), "******************")
End Sub

Private ratingColumn As Integer
 = 3

Private Sub UpdateStars(ByVal
 row As DataGridViewRow, _
    ByVal stars As String)

    row.Cells(ratingColumn).Value = stars

    ' Resize the column width to account for the new value.
    row.DataGridView.AutoResizeColumn(ratingColumn, _
        DataGridViewAutoSizeColumnMode.DisplayedCells)

End Sub
// Give cheescake excellent rating.
private void Button8_Click(object sender,
    System.EventArgs e)
{
    UpdateStars(dataGridView.Rows[4], "******************");
}

int ratingColumn = 3;

private void UpdateStars(DataGridViewRow row,
 string stars)
{

    row.Cells[ratingColumn].Value = stars;

    // Resize the column width to account for the new value.
    row.DataGridView.AutoResizeColumn(ratingColumn, 
        DataGridViewAutoSizeColumnMode.DisplayedCells);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridViewRow クラス
DataGridViewRow メンバ
System.Windows.Forms 名前空間
DataGridView クラス
DataGridViewCell クラス
DataGridViewCellCollection クラス
CreateCellsInstance



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DataGridViewRow.Cells プロパティ」の関連用語

DataGridViewRow.Cells プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataGridViewRow.Cells プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS