Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142416 | Feb 1,2019 03:16 PM UTC | Feb 26,2019 10:34 AM UTC | ASP.NET Core | 7 |
![]() |
Tags: Grid |
"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;
}
|
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.
This page will automatically be redirected to the sign-in page in 10 seconds.