Satırları ve Sütunları Ekle
Contents
[
Hide
]
Bu konu, Aspose.Cells.GridWeb API’sını kullanarak bir çalışma sayfasına yeni satırlar ve sütunlar eklemenin nasıl olduğunu açıklar. Satırlar veya sütunlar çalışma sayfasında herhangi bir konuma eklenebilir.
Satırlar Eklemek
Çalışma sayfasında herhangi bir konuma satır eklemek için:
- Aspose.Cells.GridWeb denetimini Web Formuna ekleyin.
- Satır eklemek istediğiniz çalışma sayfasına erişin.
- Satırın ekleneceği satır dizinini belirterek bir satır ekleyin.
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 | |
// Accessing the reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Get row index entered by user | |
int rowIndex = Convert.ToInt16(txtRowIndex.Text.Trim()); | |
// Add row at specified index | |
sheet.Cells.InsertRow(rowIndex); |
Sütunlar Eklemek
Çalışma sayfasında herhangi bir konuma sütun eklemek için:
- Aspose.Cells.GridWeb denetimini bir Web Formuna ekleyin.
- Sütun eklemek istediğiniz çalışma sayfasına erişin.
- Kolon eklemek için kolonun ekleneceği sütun indisini belirterek bir sütun ekleyin.
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 | |
// Accessing the reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Get column index entered by user | |
int columnIndex = Convert.ToInt16(txtColumnIndex.Text.Trim()); | |
// Add column at specified index | |
sheet.Cells.InsertColumn(columnIndex); |
Ayrıca, InsertRows/InsertColumns yöntemlerini kullanarak çalışma sayfasına sırasıyla birden fazla satır/sütun ekleyebilirsiniz.