Satırları ve Sütunları Yeniden Boyutlandır
Contents
[
Hide
]
Bazı durumlarda hücre değerleri, hücrede olduklarından daha geniş veya birkaç satıra yayılmış olabilir. Bu tür değerler, satırları ve sütunları yükseklik ve genişliklerini değiştirmedikçe kullanıcılara tamamen görünmez. Aspose.Cells.GridWeb, satır yüksekliklerini ve sütun genişliklerini ayarlama konusunda tam destek sağlar. Bu konu, bu özellikleri örneklerle detaylı olarak ele almaktadır.
Satır Yükseklikleri ve Sütun Genişlikleriyle Çalışma
Satır Yüksekliği Ayarlama
Bir satırın yüksekliğini ayarlamak için:
- Aspose.Cells.GridWeb denetimini Web Formunuza ekleyin.
- Çalışma sayfasının Hücreler koleksiyonuna erişin.
- Belirli bir satırdaki tüm hücrelerin yüksekliğini ayarlayın.
Cells koleksiyonunun SetRowHeight ve SetColumnWidth yöntemlerinin, satır yüksekliği ve sütun genişliği ölçümlerini inç ve piksel cinsinden ayarlamak için mevcut olan değişkenleri de bulunmaktadır.
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 | |
// Get row index entered by user | |
int rowIndex = Convert.ToInt16(txtRowIndex.Text.Trim()); | |
// Get row height entered by user | |
int rowHeight = Convert.ToInt16(txtRowHeight.Text.Trim()); | |
// Accessing the cells collection of the worksheet that is currently active | |
GridCells cells = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex].Cells; | |
// Resize row at specified index to specified height | |
cells.SetRowHeight(rowIndex, rowHeight); |
Sütun Genişliği Ayarlama
Bir sütunun genişliğini ayarlamak için:
- Aspose.Cells.GridWeb denetimini Web Formunuza ekleyin.
- Çalışma sayfasının Hücreler koleksiyonuna erişin.
- Belirli bir sütundaki tüm hücrelerin genişliğini ayarlayın.
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 | |
// Get column index entered by user | |
int columnIndex = Convert.ToInt16(txtColumnIndex.Text.Trim()); | |
// Get column width entered by user | |
int columnWidth = Convert.ToInt16(txtColumnWidth.Text.Trim()); | |
// Accessing the cells collection of the worksheet that is currently active | |
GridCells cells = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex].Cells; | |
// Resize column at specified index to specified width | |
cells.SetColumnWidth(columnIndex, columnWidth); |