GridWeb ダブルクリック イベントの操作

ダブルクリック イベントの有効化

GridWeb コントロールの EnableDoubleClickEvent プロパティを true に設定することにより、すべてのタイプのダブルクリック イベントをクライアント側で有効にすることができます。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Enabling Double Click events
GridWeb1.EnableDoubleClickEvent = true;

ダブルクリック イベントを有効にすると、任意のダブルクリック イベントのイベント ハンドラーを作成できます。これらのイベント ハンドラーは、特定のダブルクリック イベントが発生したときに特定のタスクを実行します。

ダブルクリック イベントの処理

Visual Studio でイベント ハンドラーを作成するには:

  1. でイベントをダブルクリックします。イベントプロパティ ペインに一覧表示されます。

この例では、さまざまなダブルクリック イベントのイベント ハンドラーを実装しました。

ダブルクリック Cell

CellDoubleClick イベントのイベント ハンドラーは、ダブルクリックされたセルの完全な情報を提供する CellEventArgs 型の引数を提供します。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Event Handler for CellDoubleClick event
protected void GridWeb1_CellDoubleClick(object sender, Aspose.Cells.GridWeb.CellEventArgs e)
{
// Displaying the name of the cell (that is double clicked) in GridWeb's Message Box
string msg = "You just clicked <";
msg += "Row: " + (e.Cell.Row + 1) + " Column: " + (e.Cell.Column + 1) + " Cell Name: " + e.Cell.Name + ">";
GridWeb1.Message = msg;
}

列ヘッダーをダブルクリック

ColumnDoubleClick イベントのイベント ハンドラーは、ダブルクリックされたヘッダーの列のインデックス番号とその他の情報を提供する RowColumnEventArgs 型の引数を提供します。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Event Handler for ColumnDoubleClick event
protected void GridWeb1_ColumnDoubleClick(object sender, Aspose.Cells.GridWeb.RowColumnEventArgs e)
{
// Displaying the number of the column (whose header is double clicked) in GridWeb's Message Box
string msg = "You just clicked <";
msg += "Column header: " + (e.Num + 1) + ">";
GridWeb1.Message = msg;
}

行ヘッダーをダブルクリック

RowDoubleClick イベントのイベント ハンドラーは、ダブルクリックされたヘッダーの行のインデックス番号とその他の関連情報を提供する RowColumnEventArgs 型の引数を提供します。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Event Handler for RowDoubleClick event
protected void GridWeb1_RowDoubleClick(object sender, Aspose.Cells.GridWeb.RowColumnEventArgs e)
{
// Displaying the number of the row (whose header is double clicked) in GridWeb's Message Box
string msg = "You just clicked <";
msg += "Row header: " + (e.Num + 1) + ">";
GridWeb1.Message = msg;
}