Изменение высоты строк и ширины столбцов

Работа с высотой строк и шириной столбцов

Установка высоты строк

Чтобы установить высоту строки:

  1. Добавьте элемент управления Aspose.Cells.GridWeb на свою веб-форму.
  2. Получить доступ к коллекции ячеек листа.
  3. Установите высоту всех ячеек в любой указанной строке.
// 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);

Установка ширины столбца

Чтобы установить ширину столбца:

  1. Добавьте элемент управления Aspose.Cells.GridWeb на свою веб-форму.
  2. Получить доступ к коллекции ячеек листа.
  3. Установить ширину всех ячеек в указанном столбце.
// 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);