تطبيق النمط على صف أو عمود
Contents
[
Hide
]
في هذا الموضوع ، سنناقش حول تغيير الخط ولون الخط للصفوف والأعمدة في ورقة العمل. هذا هو المستوى الأساسي لميزة التنسيق التي تقدمها Aspose.Cells.GridDesktop التي تمكن المطورين من تخصيص طريقة عرض أوراق العمل الخاصة بهم لجعلها أكثر قابلية للتقديم.
تطبيق النمط على عمود
لتطبيق نمط مخصص على عمود باستخدام 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(); | |
// Accessing the first column of the worksheet | |
Aspose.Cells.GridDesktop.Data.GridColumn column = sheet.Columns[0]; | |
// Adding sample value to sheet cell | |
GridCell cell = sheet.Cells["a1"]; | |
cell.SetCellValue("Aspose"); | |
// Getting the Style object for the column | |
Style style = column.GetStyle(); | |
// Setting Style properties i.e. border, alignment color etc. | |
style.SetBorderLine(BorderType.Right, BorderLineType.Thick); | |
style.SetBorderColor(BorderType.Right, Color.Blue); | |
style.HAlignment = HorizontalAlignmentType.Centred; | |
// Setting the style of the column with the customized Style object | |
column.SetStyle(style); |
تطبيق النمط على صف
لتطبيق نمط مخصص على صف باستخدام Aspose.Cells.GridDesktop ، يرجى اتباع الخطوات التالية:
- الوصول إلى أي ملفاتورقة عمل
- الوصول أصف التي نريد أن نطبق عليهاأسلوب
- يحصلأسلوب التابعصف
- تعيينأسلوب خصائص وفقا لاحتياجاتك المخصصة
- أخيرًا ، حددأسلوب التابعصف مع التحديث
هناك العديد من الخصائص والطرق المفيدة التي تقدمهاأسلوب يمكن للمطورين استخدامه لتخصيص النمط وفقًا لمتطلباتهم.
// Accessing the worksheet of the Grid that is currently active
Worksheet sheet = gridDesktop1.GetActiveWorksheet();
// Accessing the first row of the worksheet
Aspose.Cells.GridDesktop.Data.GridRow row = sheet.Rows[0];
// Getting the Style object for the row
Style style = row.GetStyle();
// Setting Style properties i.e. border, color, alignment, background color etc.
style.SetBorderLine(BorderType.Right, BorderLineType.Thick);
style.SetBorderColor(BorderType.Right, Color.Blue);
style.HAlignment = HorizontalAlignmentType.Centred;
style.Color = Color.Yellow;
// Setting the style of the row with the customized Style object
row.SetStyle(style);