تغيير حجم الصفوف والأعمدة

العمل مع ارتفاعات الصفوف وأعراض الأعمدة

ضبط ارتفاع الصف

لضبط ارتفاع صف:

  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);