In your radgrid view demo code:
Im unable to find grid.ExportToWorkbook();
this line is failing for me:
Workbook currentWorkbook = grid.ExportToWorkbook();
Code:-------------------------------------------------------------------------------------------------------
private static Workbook CreateWorkbook(RadGridView grid, PrintSettings settings)
{
EventHandler<GridViewElementExportingToDocumentEventArgs> elementExporting = (s, e) =>
{
var documentVisualExportParameters = e.VisualParameters as GridViewDocumentVisualExportParameters;
if (documentVisualExportParameters != null)
{
if (e.Element == ExportElement.HeaderRow)
{
if (settings.HeaderBackground != null)
{
documentVisualExportParameters.Style = new CellSelectionStyle() { Fill = new PatternFill(PatternType.Solid, settings.HeaderBackground, settings.HeaderBackground) };
}
}
else if (e.Element == ExportElement.GroupHeaderRow)
{
if (settings.GroupHeaderBackground != null)
{
documentVisualExportParameters.Style = new CellSelectionStyle() { Fill = new PatternFill(PatternType.Solid, settings.GroupHeaderBackground, settings.GroupHeaderBackground) };
}
}
else if (e.Element == ExportElement.Row)
{
if (settings.RowBackground != null)
{
documentVisualExportParameters.Style = new CellSelectionStyle() { Fill = new PatternFill(PatternType.Solid, settings.RowBackground, settings.RowBackground) };
}
}
}
};
grid.ElementExportingToDocument += elementExporting;
Workbook currentWorkbook = grid.ExportToWorkbook();
return currentWorkbook;
}
Im unable to find grid.ExportToWorkbook();
this line is failing for me:
Workbook currentWorkbook = grid.ExportToWorkbook();
Code:-------------------------------------------------------------------------------------------------------
private static Workbook CreateWorkbook(RadGridView grid, PrintSettings settings)
{
EventHandler<GridViewElementExportingToDocumentEventArgs> elementExporting = (s, e) =>
{
var documentVisualExportParameters = e.VisualParameters as GridViewDocumentVisualExportParameters;
if (documentVisualExportParameters != null)
{
if (e.Element == ExportElement.HeaderRow)
{
if (settings.HeaderBackground != null)
{
documentVisualExportParameters.Style = new CellSelectionStyle() { Fill = new PatternFill(PatternType.Solid, settings.HeaderBackground, settings.HeaderBackground) };
}
}
else if (e.Element == ExportElement.GroupHeaderRow)
{
if (settings.GroupHeaderBackground != null)
{
documentVisualExportParameters.Style = new CellSelectionStyle() { Fill = new PatternFill(PatternType.Solid, settings.GroupHeaderBackground, settings.GroupHeaderBackground) };
}
}
else if (e.Element == ExportElement.Row)
{
if (settings.RowBackground != null)
{
documentVisualExportParameters.Style = new CellSelectionStyle() { Fill = new PatternFill(PatternType.Solid, settings.RowBackground, settings.RowBackground) };
}
}
}
};
grid.ElementExportingToDocument += elementExporting;
Workbook currentWorkbook = grid.ExportToWorkbook();
return currentWorkbook;
}