حذف الصفوف والأعمدة
Contents
[
Hide
]
يوضح هذا الموضوع كيفية حذف الصفوف والأعمدة من ورقة العمل باستخدام واجهة برمجة التطبيقات Aspose.Cells.GridWeb. باستخدام هذه الميزة، يمكن للمطورين حذف الصفوف أو الأعمدة أثناء التشغيل.
حذف الصفوف
لحذف صف من ورقة العمل الخاصة بك:
- أضف تحكم Aspose.Cells.GridWeb إلى استمارة الويب.
- قم بالوصول إلى ورقة العمل التي تقوم بحذف الصفوف منها.
- حذف صف من ورقة العمل عن طريق تحديد فهرس صفه.
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]; | |
// 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 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 لحذف عدة صفوف/أعمدة في ورق العمل.