GridDesktop Çalışma Sayfasının Özel Satır ve Özel Sütun Başlığı

Olası Kullanım Senaryoları

GridDesktop çalışma sayfasının satır ve sütun başlığını özelleştirebilirsiniz. Normalde, satır 1’den ve sütun A’dan başlar. Bu davranışı değiştirebilir ve GridDesktop çalışma sayfasındaki satırların ve sütunların kendi başlıklarını kullanabilirsiniz. Satır ve sütun başlıklarını değiştirmek için lütfen ICustomRowCaption ve ICustomColumnCaption arabirimlerini uygulayın.

GridDesktop Çalışma Sayfasının Özel Satır ve Özel Sütun Başlığı

Aşağıdaki örnek kod, ICustomRowCaption ve ICustomColumnCaption arabirimlerini uygular ve satırların ve sütunların başlıklarını değiştirir. Ekran görüntüsü, bu örnek kodun çalıştırılmasının sonucunu göstermektedir.

todo:image_alt_text

Örnek Kod

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
public class MyICustomColumnCaption : ICustomColumnCaption
{
//Returns the Custom Column Caption
public string GetCaption(int column)
{
return "Mine " + (column + 10);
}
}
public class MyICustomRowCaption : ICustomRowCaption
{
//Returns the Custom Row Caption
public string GetCaption(int row)
{
return "R" + (row + 10).ToString();
}
}
//-------------------------------------------
//-------------------------------------------
//Access the First GridDesktop Worksheet
Worksheet ws = this.gridDesktop1.Worksheets[0];
//Assign the Worksheet Custom Column and Row Caption Instance
ws.CustomColumnCaption = new MyICustomColumnCaption();
ws.CustomRowCaption = new MyICustomRowCaption();