GridWeb ダブルクリックイベントの動作
Aspose.Cells.GridWeb には、3種類のダブルクリックイベントが含まれています:
- CellDoubleClick: セルがダブルクリックされたときに発生します。
- ColumnDoubleClick: 列ヘッダがダブルクリックされたときに発生します。
- RowDoubleClick: 行ヘッダがダブルクリックされたときに発生します。
このトピックでは、Aspose.Cells.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 でイベントハンドラを作成するには:
- プロパティペインの イベント リストでイベントをダブルクリックします。
この例では、さまざまなダブルクリックイベントのためのイベントハンドラを実装しました。
セルのダブルクリック
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 イベントのイベントハンドラは、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; | |
} |