حذف الصفوف والأعمدة
Contents
[
Hide
]
يوضح هذا الموضوع كيفية حذف الصفوف والأعمدة من ورقة العمل باستخدام Aspose.Cells.GridWeb API. بمساعدة هذه الميزة ، يمكن للمطورين حذف الصفوف أو الأعمدة في وقت التشغيل.
حذف الصفوف
لحذف صف من ورقة العمل الخاصة بك:
- قم بإضافة عنصر تحكم Aspose.Cells.GridWeb إلى نموذج ويب.
- قم بالوصول إلى ورقة العمل التي تحذف الصفوف منها.
- احذف صفًا من ورقة العمل عن طريق تحديد فهرس الصف الخاص به.
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 reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Get row index entered by user | |
int rowIndex = Convert.ToInt16(txtRowIndex.Text.Trim()); | |
// Delete row at specified index | |
sheet.Cells.DeleteRow(rowIndex); |
حذف الأعمدة
لحذف عمود من ورقة العمل الخاصة بك:
- قم بإضافة عنصر تحكم Aspose.Cells.GridWeb إلى نموذج ويب.
- قم بالوصول إلى ورقة العمل التي تريد حذف الأعمدة منها.
- احذف عمودًا من ورقة العمل عن طريق تحديد فهرس العمود الخاص به.
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 reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Get column index entered by user | |
int columnIndex = Convert.ToInt16(txtColumnIndex.Text.Trim()); | |
// Delete column at specified index | |
sheet.Cells.DeleteColumn(columnIndex); |
يمكنك أيضًا استخدام طرق DeleteRows / DeleteColumns لحذف صفوف / أعمدة متعددة في أوراق العمل.