GridWeb ダブルクリック イベントの操作
Contents
[
Hide
]
Aspose.Cells.GridWeb には、次の 3 種類のダブルクリック イベントが含まれています。
- CellDoubleClick は、セルがダブルクリックされたときに発生します。
- ColumnDoubleClick は、列ヘッダーがダブルクリックされたときに発生します。
- RowDoubleClick、行ヘッダーがダブルクリックされたときに発生します。
このトピックでは、Aspose.Cells.GridWeb でダブルクリック イベントを有効にする方法について説明します。また、これらのイベントのイベント ハンドラーの作成についても説明します。
ダブルクリック イベントの有効化
GridWeb コントロールの EnableDoubleClickEvent プロパティを true に設定することにより、すべてのタイプのダブルクリック イベントをクライアント側で有効にすることができます。
デフォルトでは、EnableDoubleClickEvent プロパティは false に設定されています。これは、デフォルトではダブルクリック イベントが有効になっていないことを意味します。このようなイベントを実装するには、まず機能を有効にします。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 でイベント ハンドラーを作成するには:
- でイベントをダブルクリックします。イベントプロパティ ペインに一覧表示されます。
この例では、さまざまなダブルクリック イベントのイベント ハンドラーを実装しました。
ダブルクリック Cell
CellDoubleClick イベントのイベント ハンドラーは、ダブルクリックされたセルの完全な情報を提供する CellEventArgs 型の引数を提供します。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 型の引数を提供します。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 型の引数を提供します。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} |