Skip to content

Commit e050785

Browse files
committed
review changes
1 parent 02098df commit e050785

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed
130 KB
Loading

MAUI/DataGrid/export-to-excel.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,10 +1055,11 @@ private void ExcelExport_RowExporting(object sender, DataGridRowExcelExportingEv
10551055

10561056
### Exporting DetailsView
10571057

1058-
By default, [DetailsViewDataGrid](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DetailsViewDataGrid.html) will be exported to Excel. You can customize its exporting operation by using `DataGridChildExcelExportingEventArgs`.
1058+
By default, [DetailsViewDataGrid](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DetailsViewDataGrid.html) will not be exported to Excel. You can export `DetailsViewDataGrid` by setting `CanExportDetailsView` property as true. You can customize its exporting operation by using `DataGridChildExcelExportingEventArgs`.
10591059

10601060
## Excluding DetailsViewDataGrid while exporting
1061-
You can exclude particular DetailsViewDataGrid while exporting, by using the DataGridChildExcelExportingEventArgs and `DataGridChildExcelExportingEventArgs.Cancel`.
1061+
1062+
You can exclude particular DetailsViewDataGrid while exporting by using the `DataGridChildExcelExportingEventArgs.Cancel` property.
10621063

10631064
```csharp
10641065
private void Button_Clicked_1(object sender, EventArgs e)
@@ -1077,6 +1078,7 @@ private void Button_Clicked_1(object sender, EventArgs e)
10771078
SaveService saveService = new();
10781079
saveService.SaveAndView(OutputFilename, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", stream);
10791080
}
1081+
10801082
private void ExcelExport_DataGridChildExcelExporting(object? sender, DataGridChildExcelExportingEventArgs e)
10811083
{
10821084
var recordEntry = e.NodeEntry as RecordEntry;
@@ -1090,7 +1092,8 @@ private void ExcelExport_DataGridChildExcelExporting(object? sender, DataGridChi
10901092
Here, `DetailsViewDataGrid` is not exported for the parent record having OrderID as 1002.
10911093

10921094
## Customizing DetailsViewDataGrid cells
1093-
Like parent DataGrid, You can customize the DetailsViewDataGrid cells also by using [DataGridCellExcelExportingEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.Exporting.DataGridCellExcelExportingEventArgs.html).
1095+
1096+
Similar to the parent DataGrid, you can also customize the cells of the DetailsViewDataGrid using the [DataGridCellExcelExportingEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.Exporting.DataGridCellExcelExportingEventArgs.html). By utilizing the `DataGridCellExcelExportingEventArgs.DetailsViewDefinition` property, you can identify the specific DetailsViewDataGrid and make your customizations.
10941097

10951098
```csharp
10961099
private void Button_Clicked_1(object sender, EventArgs e)
@@ -1117,7 +1120,7 @@ Like parent DataGrid, You can customize the DetailsViewDataGrid cells also by us
11171120
return;
11181121
}
11191122

1120-
if (e.ColumnName == "ProductID")
1123+
if (e.ColumnName == "OrderID")
11211124
{
11221125
e.Range.CellStyle.Font.Size = 12;
11231126
e.Range.CellStyle.Font.Color = ExcelKnownColors.Blue;

MAUI/DataGrid/export-to-pdf.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,10 +1183,13 @@ Here, first record only expanded in SfDataGrid. But all the DetailsViewDataGrid
11831183

11841184
You can customize its exporting operation by using `DataGridChildPdfExportingEventArgs`.
11851185

1186+
N> While exporting DetailsViewDataGrid, `CanFitAllColumnInOnePage` is set to true internally as horizontal pagination is not supported for DetailsViewDataGrid.
1187+
11861188
By default, [DetailsViewDataGrid](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DetailsViewDataGrid.html) will be exported to PDF. You can customize its exporting operation by using `DataGridChildPdfExportingEventArgs`.
11871189

11881190
## Excluding DetailsViewDataGrid while exporting
1189-
You can exclude particular DetailsViewDataGrid while exporting, by using the DataGridChildExcelExportingEventArgs and `DataGridChildPdfExportingEventArgs.Cancel`.
1191+
1192+
You can exclude particular DetailsViewDataGrid while exporting, by using the `DataGridChildPdfExportingEventArgs.Cancel`.
11901193

11911194
```csharp
11921195
private void Button_Clicked(object sender, EventArgs e)
@@ -1211,12 +1214,13 @@ private void PdfExport_DataGridChildPdfExporting(object? sender, DataGridChildPd
12111214
e.Cancel = true;
12121215
}
12131216
```
1214-
<img alt="Excluding specific DetailsView while exporting to Excel in DataGrid " src="Images\export-to-excel\maui-datagrid-detailsviewexporting.png" Width="404"/>
1217+
<img alt="Excluding specific DetailsView while exporting to PDF in DataGrid " src="Images/export-to-pdf/maui-datagrid-excluderows.png" Width="404"/>
12151218

12161219
Here, `DetailsViewDataGrid` is not exported for the parent record having OrderID as 1002.
12171220

12181221
## Customizing DetailsViewDataGrid cells
1219-
Like parent DataGrid, you can customize the DetailsViewDataGrid cells also by using [DataGridCellPdfExportingEventArgs](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.Exporting.DataGridCellPdfExportingEventArgs.html).Based on `DataGridCellPdfExportingEventArgs.DetailsViewDefinition` property, you can identify the particular DetailsViewDataGrid and customize it.
1222+
1223+
Similar to the parent DataGrid, you can also customize the cells of the DetailsViewDataGrid by using the DataGridCellPdfExportingEventArgs. By utilizing the `DataGridCellPdfExportingEventArgs.DetailsViewDefinition` property, you can identify the specific DetailsViewDataGrid and customize it accordingly.
12201224

12211225
```csharp
12221226
private void Button_Clicked_1(object sender, EventArgs e)
@@ -1234,7 +1238,7 @@ Like parent DataGrid, you can customize the DetailsViewDataGrid cells also by us
12341238
saveService.SaveAndView("ExportFeature.pdf", "application/pdf", stream);
12351239
}
12361240

1237-
private void ExcelExport_CellExporting(object? sender, DataGridCellExcelExportingEventArgs e)
1241+
private void PdfExport_CellExporting(object? sender, DataGridCellPdfExportingEventArgs e)
12381242
{
12391243
if (e.DetailsViewDefinition == null && e.DetailsViewDefinition?.RelationalColumn != "OrdersList")
12401244
{
@@ -1250,6 +1254,4 @@ Like parent DataGrid, you can customize the DetailsViewDataGrid cells also by us
12501254
}
12511255
}
12521256
```
1253-
<img alt="Customizing DetailsViewDataGrid while exporting to PDF in DataGrid" src="Images\export-to-pdf\maui-datagrid-customize-detailsview.png" Width="404"/>
1254-
1255-
1257+
<img alt="Customizing DetailsViewDataGrid while exporting to PDF in DataGrid" src="Images/export-to-pdf/maui-datagrid-customize-detailsview.png" Width="404"/>

0 commit comments

Comments
 (0)