"Scripts/ej.localetexts.fr-FR.js" or "
Scripts/ej.localetexts.de-DE.js"
@*Kindly ensure to refer the corresponding culture and localetext*@
<script src="~/lib/syncfusion-ej-global/i18n/ej.culture.fr-FR.min.js"></script>
<script src="~/lib/syncfusion-ej-global/i18n/ej.culture.de-DE.min.js"></script>
<script src="~/lib/syncfusion-ej-global/l10n/ej.localetexts.de-DE.min.js"></script>
<script src="~/lib/syncfusion-ej-global/l10n/ej.localetexts.fr-FR.min.js"></script>
<ej-grid id="FlatGrid" allow-paging="true" locale="fr-FR">
<e-datamanager json="(IEnumerable<object>)ViewBag.datasource" adaptor="remoteSaveAdaptor" />
………………………………………….
</ej-grid>
<br>
<ej-grid id="FlatGrid1" allow-paging="true" locale="de-DE">
<e-datamanager json="(IEnumerable<object>)ViewBag.datasource" adaptor="remoteSaveAdaptor" />
………………………………………………………
</ej-grid>
<script type="text/javascript">
ej.Grid.Locale["fr-FR"] = {
EmptyRecord: "Aucun enregistrement à afficher",
…………………………………………………………………………
UnGroup: "Cliquez ici pour dégrouper"
};
ej.Pager.Locale["fr-FR"] = {
pagerInfo: "{0} de {1} Pages ({2} Articles)",
firstPageTooltip: "Aller à la première page",
………………………………………….
};
ej.Grid.Locale["de-DE"] = {
EmptyRecord: "Keine Aufzeichnungen angezeigt",
……………………………………….
};
ej.Pager.Locale["de-DE"] = {
……………………………………………………………………….
previousPagerTooltip: "Zum vorherigen Pager"
};
</script> |
|
<ej-grid id="FlatGrid"
allow-sorting="true"
selectiontype="Multiple" datasource="ViewBag.datasource" allow-paging="true" toolbar-click="click">
<e-edit-settings allow-adding="true" allow-editing="true" allow-deleting="true" edit-mode="@(EditMode.Normal)"></e-edit-settings>
<e-toolbar-settings show-toolbar="true" toolbar-items=@(new List<string>() {"excelExport","wordExport","pdfExport" })>
</e-toolbar-settings>
<e-columns>
<e-column field="OrderID" header-text="Order ID" text-align="Right" width="75" is-primary-key="true"></e-column>
. . .
</e-columns>
</ej-grid>
Serverside:-
public ActionResult GridFeatures()
{
if (order.Count() == 0)
BindDataSource();
ViewBag.datasource = order;
return View();
}
public ActionResult ExportToExcel(string GridModel)
{
ExcelExport exp = new ExcelExport();
var DataSource = order;
GridProperties gridProp = ConvertGridObject(GridModel);
GridExcelExport excelExp = new GridExcelExport();
excelExp.FileName = "Export.xlsx"; excelExp.Excelversion = ExcelVersion.Excel2010;
excelExp.Theme = "flat-saffron";
return exp.Export(gridProp, DataSource, excelExp);
}
public ActionResult ExportToWord(string GridModel)
{
WordExport exp = new WordExport();
var DataSource = order;
GridProperties gridProp = ConvertGridObject(GridModel);
GridWordExport wrdExp = new GridWordExport();
wrdExp.FileName = "Export.docx"; wrdExp.Theme = "flat-saffron";
return exp.Export(gridProp, DataSource, wrdExp);
}
private GridProperties ConvertGridObject(string gridProperty)
{
GridProperties gridProp = new GridProperties();
gridProp = (GridProperties)JsonConvert.DeserializeObject(gridProperty, typeof(GridProperties));
return gridProp;
}
|