GridWeb Çift Tıklayın Olayları ile Çalışma

Çift Tıklama Olaylarını Etkinleştirme

Tüm çift tıklama olayları, GridWeb kontrolünün EnableDoubleClickEvent özelliğinin true olarak ayarlanmasıyla istemci tarafında etkinleştirilebilir.

// 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;

Çift tıklama olayları etkinleştirildiğinde, herhangi bir çift tıklama olayı için olay işleyicileri oluşturmak mümkündür. Bu olay işleyicileri, belirli bir çift tıklama olayı tetiklendiğinde belirli görevleri gerçekleştirir.

Çift Tıklama Olaylarını Ele Almak

Visual Studio’da bir olay işleyici oluşturmak için:

  1. Özellikler bölmesindeki Olaylar listesinde bir olaya çift tıklayın.

Bu örnekte, çeşitli çift tıklama olayları için olay işleyicileri uyguladık.

Hücreyi Çift Tıklama

CellDoubleClick olay işleyicisi, çift tıklanan hücre ile ilgili tam bilgiyi sağlayan CellEventArgs türünden bir argüman sağlar.

// 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;
}

Sütun Başlığını Çift Tıklama

ColumnDoubleClick olay işleyicisi, çift tıklanan başlık için sütunun indeks numarasını ve diğer bilgileri sağlayan RowColumnEventArgs türünden bir argüman sağlar.

// 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;
}

Satır Başlığını Çift Tıklama

RowDoubleClick olay işleyicisi, çift tıklanan başlık için satırın indeks numarasını ve diğer ilgili bilgileri sağlayan RowColumnEventArgs türünden bir argüman sağlar.

// 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;
}