On Fri, 4 Nov 2005 18:19:05 -0800
"cs" <c...@discussions.microsoft.com> wrote:
> 'System.Windows.Forms.DataGridView' に 'CurrentRowIndex'の定義がありません。
> と表示されて、驚いてしまいました。
ヘルプによれば、CurrentRow プロパティはありますが、
CurrentRowIndex というプロパティはありませんね。
---
MVP kaok = MVP.ChangeMvpCategory("for C# 2004-2006.");
kaok.Web = "http://www.antoine.st/";
On Fri, 4 Nov 2005 19:07:03 -0800
"cs" <c...@discussions.microsoft.com> wrote:
> 私のしりたいことと、この記事とは無関係だったのでしょうか?
DataGrid と DataGridView は別物ですよ。DataGrid には、件のプ
ロパティが存在します。
しかし、DataGrid は DataGridView に置き換えられるというもの
ですので、特に理由がないのであれば、DataGridView を使うほう
がよさそうですね。
DataGridView であれば、CurrentRow.Index で CurrentRowIndex
相当の値が取得できそうです。
On Fri, 4 Nov 2005 21:32:01 -0800
"cs" <c...@discussions.microsoft.com> wrote:
> 今度は、Getでなく、Setするには、というものです。
CurrentRow のヘルプトピックに、
|| To change the current row, you must set the CurrentCell
|| property to a cell in the desired row.
とあります。CurrentCell プロパティを使うようですね。
myGrid
と入力した後で、ピリオドを打つと、スニペットが現れて、
CurrentCellをポイントしたうえで、それを読むと、
DataGridViewCell DataGridView.CurrentCell
Gets or sets the currently active cell.
と表示されます。そこで、CurrentCellとピリオドを入力すると
次の候補がスニペットに表示されます。
これを1つずつ読んでいくと、
RowIndex では、
int DataGridViewCell.RowIndex
Gets the index of the cell's parent row.
と表示されますので、これではSet(割り当て)できないことが分かりました。
それでは違うものをと、探しても、
DataGridViewの表示位置(行)を設定しそうなものが見当たりません。
そして、CurrentCell の代わりに、CurrentRow で、設定できるのかと、
これもスニペットで読んでみても、Getのみで、
Gets the row containing the current cell.
と、表示されます。
それらしいような、CurrentCellAddressもだめ、
dailyGrid.FirstDisplayedCell.RowIndex = iPos; では読み取り専用。
もしや、メソッドを作り忘れたのでは???
そんなことはないでしょうけれど。