调整行和列大小

操作行高度和列宽度

设置行高度

设置行的高度:

  1. 将Aspose.Cells.GridWeb控件添加到您的Web表单中。
  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控件添加到您的Web表单中。
  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);