DataGrid.CurrentRowIndex プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As DataGrid Dim value As Integer value = instance.CurrentRowIndex instance.CurrentRowIndex = value
/** @property */ public int get_CurrentRowIndex () /** @property */ public void set_CurrentRowIndex (int value)
現在の行の 0 から始まるインデックス番号。


CurrentRowIndex プロパティを現在の値から変更すると、指定された行が表示される位置までコントロールがスクロールされます。
CurrentRowIndex プロパティを使用すると、子テーブルの行を表示していても、親テーブルの行を反復処理できます。たとえば、子テーブルを表示しているときに、CurrentRowIndex をインクリメントすると、System.Windows.Forms.DataGrid によって親テーブルへリンクされた次のレコードセットが子テーブルに表示されます。
ユーザーが、子リレーションシップがないテーブルまたは親テーブルを表示しているときは、プロパティによって現在の行の 0 から始まるインデックス番号が返されます。

CurrentRowIndex を取得するコード例を次に示します。
Private Sub GetSelectedIndex(ByVal myGrid As DataGrid) Console.WriteLine(myGrid.CurrentRowIndex) End Sub Private Sub SetSelectedIndex(ByVal myGrid As DataGrid, ByVal selIndex As Integer) myGrid.CurrentRowIndex= selIndex End Sub
private void GetSelectedIndex(DataGrid myGrid){ Console.WriteLine(myGrid.CurrentRowIndex); } private void SetSelectedIndex(DataGrid myGrid, int selIndex){ myGrid.CurrentRowIndex = selIndex; }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からDataGrid.CurrentRowIndex プロパティを検索する場合は、下記のリンクをクリックしてください。

- DataGrid.CurrentRowIndex プロパティのページへのリンク