Mostra i pulsanti per aggiungere/rimuovere fogli di lavoro

Aspose.Cells GridWeb ora supporta l’aggiunta e la rimozione di fogli utilizzando i pulsanti nella barra degli strumenti. Affinché i pulsanti siano visibili sul frontend, è necessario impostareGridWeb1.ShowAddButton aVERO. Il seguente frammento di codice illustra l’aggiunta di pulsanti Aggiungi/Rimuovi alla barra degli strumenti GridWeb.

Codice d’esempio

// 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;
}