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