Cell Denetimlerini Sütunlarda Yönetme

Cell Kontrollerine Erişim

Sütundaki mevcut bir hücre kontrolüne erişmek ve değiştirmek için, geliştiriciler bir hücrenin CellControl özelliğini kullanabilir.Aspose.Cells.GridDesktop.Data.GridColumn . Bir hücre kontrolüne erişildiğinde, geliştiriciler çalışma zamanında özelliklerini değiştirebilir. Örneğin, aşağıda verilen örnekte, mevcut birOnay Kutusu Belirli bir hücreden kontrolAspose.Cells.GridDesktop.Data.GridColumn ve Checked özelliğini değiştirdi.

ÖNEMLİ: CellControl özelliği, şu şekilde bir hücre denetimi sağlar:Hücre Kontrolünesne. Bu nedenle, belirli bir hücre kontrolü türüne erişmeniz gerekirse, diyelim kiOnay Kutusu o zaman şunu yazmanız gerekecek:Hücre Kontrolü itiraz etmekOnay Kutusu sınıf.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Accessing the worksheet of the Grid that is currently active
Worksheet sheet = gridDesktop1.GetActiveWorksheet();
// Accessing cell control in the column and typecasting it to CheckBox
Aspose.Cells.GridDesktop.CheckBox cb = (Aspose.Cells.GridDesktop.CheckBox)sheet.Columns[2].CellControl;
if (cb != null)
{
// Modifying the Checked property of CheckBox
cb.Checked = true;
}
else
{
MessageBox.Show("Please add control before accessing it.");
}

Cell Denetimlerini Kaldırma

Mevcut bir hücre denetimini kaldırmak için, geliştiriciler yalnızca istenen bir çalışma sayfasına erişebilir ve ardındanKaldırmak kullanarak belirli sütundan hücre kontrolüHücre Denetimini Kaldır yöntemiAspose.Cells.GridDesktop.Data.GridColumn.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Accessing the worksheet of the Grid that is currently active
Worksheet sheet = gridDesktop1.GetActiveWorksheet();
// Removing cell control from the column
sheet.Columns[2].RemoveCellControl();