Hello.
I'm using version 15.40.20.
There's a way in my ID field in the grid as follows.
All url information comes from direct printing.
In pdf and excel printing, the ID field does not appear at all.
How can I solve the problem?
source code is below:
@(Html.EJ().Grid<object>("PersonelListele")
.Datasource((IEnumerable<object>)ViewBag.Personel)
.AllowSorting()
.AllowPaging()
.AllowResizing()
.AllowResizeToFit()
.CommonWidth(100)
.ShowColumnChooser()
.PageSettings(p => { p.PageSize(50); })
.ClientSideEvents(eve => { eve.DataBound("databound").ActionComplete("actioncomplete").Create("create").ToolbarClick("ToolBarClick"); })
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Search);
items.AddTool(ToolBarItems.ExcelExport);
items.AddTool(ToolBarItems.PdfExport);
items.AddTool(ToolBarItems.PrintGrid);
});
toolbar.CustomToolbarItems(new List<object>() { new Syncfusion.JavaScript.Models.CustomToolbarItem() { TemplateID = "#sifirla" } });
})
.ClientSideEvents(eve => eve.BeforePrint("beforePrint").ActionBegin("actionbegin"))
.Mappers(map => map.ExportToExcelAction(Url.Action("ExportToExcel")).ExportToPdfAction(Url.Action("ExportToPdf")))
.Columns(col =>
{
bool Primary = true;
foreach (var item in (IEnumerable<AllClassController.Kolon>)ViewBag.Kolon)
{
if (Primary)
{
col.Field(item.KolonKod).HeaderText(item.KolonAdi).Template("#SistemID").TextAlign(TextAlign.Center).Width(100).IsPrimaryKey(true).Add();
Primary = false;
}
else
{
col.Field(item.KolonKod).HeaderText(item.KolonAdi).Format("{0:dd/MM/yyyy}").Add();
}
}
}))