We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Want to delete row in the grid

Thread ID:

Created:

Updated:

Platform:

Replies:

117490 Oct 30,2014 04:22 AM UTC Nov 3,2014 12:43 PM UTC WinForms 3
loading
Tags: PivotGridControl
Ashokraj
Asked On October 30, 2014 04:22 AM UTC

Hi
   I am using pivot grid in my form, I want to delete active row in the grid.
please send the sample coding for my requirement
 
Regards
T.Ashokraj
 

Neelakandan Kannan [Syncfusion]
Replied On October 30, 2014 12:52 PM UTC

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


Ashokraj
Replied On October 31, 2014 04:29 AM UTC

Hi Kannan
Thanks for your reply.
 
Already i used Hiderows in my code its works perfectly but while exporting my grid to excel,Hided rows also showing in the excel so only i decided to delete that row.
please give any other solution's for my issue.
 
Thanks & Regards
T.Ashokraj

Neelakandan Kannan [Syncfusion]
Replied On November 3, 2014 12:43 PM UTC

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


Attachment: Pivot_Exporting_Without_subtotal_and_Row_f9ff8d63.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;