显示添加/删除工作表的按钮

Contents
[ ]

Aspose.Cells GridWeb 现在支持使用工具栏中的按钮添加和删除工作表。为了使按钮在前端可见,您需要设置GridWeb1.ShowAddButton真的.以下代码片段演示了向 GridWeb 工具栏添加添加/删除按钮。

示例代码

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
protected void Page_Load(object sender, EventArgs e)
{
GridWeb1.SheetAdded += GridSheetAdded;
// If first visit this page clear GridWeb1 and load data
if (!IsPostBack && !GridWeb1.IsPostBack)
{
// Show button to add and delete sheet
GridWeb1.ShowAddButton = true;
GridWeb1.WorkSheets.Clear();
GridWeb1.WorkSheets.Add();
}
}
void GridSheetAdded(object sender, GridWorksheet sheet)
{
sheet.Cells.StandardHeightPixels = 30;
sheet.Cells.StandardWidthPixels = 100;
}