BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi Ashokraj,
Thank you for your interest in Syncfusion products.
If you want to delete the row from Pivotgrid, you can use HideRows property. Please make use of below code,
this.pivotGridControl1.TableModel.HideRows[RowIndex] = true; // The row which you want to delete
Please let me know if I misunderstood your query.
Regards,
Neelakandan
Hi Ashokraj,
Thank you for your update.
If you want to export the PivotGrid without hidden rows, you need to export the TableModel of the PivotGrid. Because it will export the current structure of the Pivotgrid.
Please refer the below code:
private void buttonAdv2_Click(object sender, EventArgs e)
{
SaveFileDialog savedialog = new SaveFileDialog();
savedialog.AddExtension = true;
savedialog.FileName = "Sample";
savedialog.DefaultExt = "xlsx";
savedialog.Filter = "Excel file (.xlsx)|*.xlsx";
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2010;
IWorkbook chartBook = ExcelUtils.CreateWorkbook(1);
chartBook.Version = ExcelVersion.Excel2010;
IWorksheet sheet = chartBook.Worksheets[0];
Syncfusion.GridExcelConverter.GridExcelConverterControl grid = new Syncfusion.GridExcelConverter.GridExcelConverterControl();
grid.QueryImportExportCellInfo += new Syncfusion.GridExcelConverter.GridImportExportCellInfoEventHandler(grid_QueryImportExportCellInfo);
grid.GridToExcel(this.pivotGridControl1.TableModel, sheet, Syncfusion.GridExcelConverter.ConverterOptions.Default);
chartBook.SaveAs("sample.xlsx");
Process.Start("sample.xlsx");
}
Note:
In the sample you can also export pivot grid without SubTotal row. Please refer the attached sample.
Please let me know if you have further concerns.
Regards,
Neelakandan