DataGridView.InvalidateRow メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataGridView.InvalidateRow メソッドの意味・解説 

DataGridView.InvalidateRow メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

DataGridView の指定された行無効化して、強制的に描画ます。

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

Public Sub InvalidateRow ( _
    rowIndex As Integer _
)
Dim instance As DataGridView
Dim rowIndex As Integer

instance.InvalidateRow(rowIndex)
public void InvalidateRow (
    int rowIndex
)
public:
void InvalidateRow (
    int rowIndex
)
public void InvalidateRow (
    int rowIndex
)
public function InvalidateRow (
    rowIndex : int
)

パラメータ

rowIndex

無効化する行のインデックス

例外例外
例外種類条件

ArgumentOutOfRangeException

rowIndex有効な範囲 (0 ~行数 - 1) 内にありません。

解説解説
使用例使用例

行を描画するシナリオInvalidateRow メソッド使用する方法コード例次に示します。この例では、現在のセル変更されたときに行が無効化され、行が強制的に描画されます。

ここに示すコードは、「方法 : Windows フォームの DataGridView コントロールの行の外観カスタマイズする」で取り上げられているコード一部です。

' Forces the row to repaint itself when the user changes the 
' current cell. This is necessary to refresh the focus rectangle.
Sub dataGridView1_CurrentCellChanged(ByVal
 sender As Object, _
    ByVal e As EventArgs) Handles
 dataGridView1.CurrentCellChanged

    If oldRowIndex <> -1 Then
        Me.dataGridView1.InvalidateRow(oldRowIndex)
    End If
    oldRowIndex = Me.dataGridView1.CurrentCellAddress.Y

End Sub 'dataGridView1_CurrentCellChanged
// Forces the row to repaint itself when the user changes the 
// current cell. This is necessary to refresh the focus rectangle.
void dataGridView1_CurrentCellChanged(object sender, EventArgs
 e)
{
    if (oldRowIndex != -1)
    {
        this.dataGridView1.InvalidateRow(oldRowIndex);
    }
    oldRowIndex = this.dataGridView1.CurrentCellAddress.Y;
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からDataGridView.InvalidateRow メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDataGridView.InvalidateRow メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDataGridView.InvalidateRow メソッド を検索

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

辞書ショートカット

すべての辞書の索引

DataGridView.InvalidateRow メソッドのお隣キーワード
検索ランキング

   

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



DataGridView.InvalidateRow メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS