تغيير حجم الصفوف والأعمدة
Contents
[
Hide
]
في بعض الأحيان تكون قيم الخلية أعرض مما هي عليه في الخلية التي تقع فيها، أو تكون على عدة أسطر. لا تكون تلك القيم مرئية بالكامل للمستخدمين ما لم يقوموا بتغيير ارتفاع الصفوف وعرض الأعمدة. تدعم Aspose.Cells.GridWeb بالكامل ضبط ارتفاع الصفوف وعرض الأعمدة. تناقش هذا الموضوع هذه الميزات بالتفصيل مع المساعدة من الأمثلة.
العمل مع ارتفاعات الصفوف وأعراض الأعمدة
ضبط ارتفاع الصف
لضبط ارتفاع صف:
- أضف عنصر تحكم Aspose.Cells.GridWeb إلى نموذج الويب الخاص بك.
- الوصول إلى مجموعة الخلايا في ورقة العمل.
- ضبط ارتفاع جميع الخلايا في أي صف محدد.
دالة SetRowHeight و SetColumnWidth في مجموعة الخلايا تتيح أيضًا إمكانية ضبط ارتفاع الصف وعرض العمود بوحدات البوصة والبكسل.
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); |
ضبط عرض العمود
لضبط عرض عمود:
- أضف عنصر تحكم Aspose.Cells.GridWeb إلى نموذج الويب الخاص بك.
- الوصول إلى مجموعة الخلايا في ورقة العمل.
- تعيين عرض جميع الخلايا في أي عمود محدد.
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); |