ضبط عرض العمود أو ارتفاع الصف
Contents
[
Hide
]
يناقش هذا الموضوع تعيين عرض العمود وارتفاع الصف باستخدام Aspose.Cells.GridDesktop API. في بعض الأحيان ، تحتوي خلايا ورقة العمل على قيم أعرض من الخلية الأصلية. يجعل من الصعب على المستخدمين قراءة محتوى الخلية. لا يحب بعض المستخدمين استخدام مفتاح السهم الأيمن لعرض القيمة الكاملة في الخلية. لحل مثل هذه المشاكل ، يمكن للمطورين تغيير عرض العمود. يؤدي تغيير ارتفاع الصف إلى حل مشكلات مماثلة.
ضبط عرض العمود
لتعيين عرض عمود باستخدام Aspose.Cells.GridDesktop:
- قم بالوصول إلى ورقة العمل.
- قم بالوصول إلى العمود الذي تريد تغيير عرضه.
- اضبط عرض العمود.
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 | |
// Accessing the worksheet of the Grid that is currently active | |
Worksheet sheet = gridDesktop1.GetActiveWorksheet(); | |
// Adding sample value to sheet cell | |
GridCell cell = sheet.Cells["a1"]; | |
cell.SetCellValue("Welcome to Aspose!"); | |
// Accessing the first column of the worksheet | |
Aspose.Cells.GridDesktop.Data.GridColumn column = sheet.Columns[0]; | |
// Setting the width of the column | |
column.Width = 150; |
ضبط ارتفاع الصف
لضبط ارتفاع صف باستخدام Aspose.Cells.GridDesktop ، يرجى اتباع الخطوات التالية:
- قم بالوصول إلى أي ورقة عمل مطلوبة.
- قم بالوصول إلى الصف الذي تريد تغيير ارتفاعه.
- اضبط ارتفاع الصف.
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 | |
// Accessing the worksheet of the Grid that is currently active | |
Worksheet sheet = gridDesktop1.GetActiveWorksheet(); | |
// Adding sample value to sheet cells | |
GridCell cell = sheet.Cells["b2"]; | |
cell.SetCellValue("1"); | |
cell = sheet.Cells["c2"]; | |
cell.SetCellValue("2"); | |
cell = sheet.Cells["d2"]; | |
cell.SetCellValue("3"); | |
cell = sheet.Cells["e2"]; | |
cell.SetCellValue("4"); | |
// Accessing the first row of the worksheet | |
Aspose.Cells.GridDesktop.Data.GridRow row = sheet.Rows[1]; | |
// Setting the height of the row | |
row.Height = 100; |