دمج وفك دمج Cells
Contents
[
Hide
]
Aspose.Cells.GridWeb له ميزة مفيدة تتيح لك دمج الخلايا في خلية واحدة كبيرة. يصف هذا الموضوع كيفية دمج الخلايا برمجيًا.
دمج Cells
دمج خلايا متعددة في ورقة عمل في خلية واحدة عن طريق استدعاء أسلوب دمج المجموعة Cells. حدد نطاق الخلايا المراد دمجها عند استدعاء أسلوب الدمج.
إذا قمت بدمج عدة خلايا وكانت كل خلية تحتوي على بيانات ، فسيتم الاحتفاظ فقط بمحتوى الخلية العلوية اليسرى في النطاق بعد الدمج. لا تضيع البيانات الموجودة في الخلايا الأخرى. إذا قمت بإلغاء دمج الخلايا ، تستعيد كل خلية بياناتها.
تم دمج أربع خلايا في واحدة
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 | |
// Accessing the reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Merging cells starting from the cell with 3rd row and 3rd column. | |
// 2 rows and 2 columns will be merged from the starting cell | |
sheet.Cells.Merge(2, 2, 2, 2); |
اندماج Cells
لإلغاء دمج الخلايا ، استخدم أسلوب UnMerge الخاص بالمجموعة Cells الذي يأخذ نفس المعلمات مثل أسلوب الدمج وينفذ إلغاء دمج الخلايا.
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 | |
// Accessing the reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Unmerging cells starting from the cell with 3rd row and 3rd column. | |
// 2 rows and 2 columns will be unmerged from the starting cell | |
sheet.Cells.UnMerge(2, 2, 2, 2); |