Hi,
I know this is probably a silly question, but how do I ensure that my grid is always rendered the same between browsers?
I am currently only testing in Chrome and that works great. When I switch to Edge, the grid lines are not aligned and the search box disappears and I can no longer edit the grid.
1) Please share your complete Grid rendering code.
<div id="dataGrid">
@Html.EJS().Grid("products").DataSource((IEnumerable<object>)ViewBag.products).EnableStickyHeader(true).Width("auto").Columns(col =>
{
col.Field("ProductCode").HeaderText("Code").HeaderText("Code").IsPrimaryKey(true).AutoFit(true).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Add();
col.Field("Description").HeaderText("Item").Width("400px").HeaderText("Item").AllowEditing(false).Add();
col.Field("Colour").HeaderText("Colour").AllowEditing(false).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Add();
col.Field("Price").HeaderText("Price Ex VAT").Format("C2").Width("150px").AllowEditing(false).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Add();
col.Field("Pack").HeaderText("Pack").AllowEditing(false).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Add();
col.Field("Barcode").HeaderText("Barcode").AllowEditing(false).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Add();
col.HeaderText("Image").Template("#template").AllowEditing(false).Width("90px").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Add();
col.Field("QtyToOrder").HeaderText("Order").EditType("numericedit").ValidationRules(new { required = true }).Edit(new { @params= new Syncfusion.EJ2.Inputs.NumericTextBox() { ShowSpinButton = false, Min = 0, ValidateDecimalOnType=true,Decimals=0,Format="N" }}).Width("100px").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Add();
col.Field("LineTotal").HeaderText("Total").AllowEditing(false).Format("C2").Width("150px").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Center).Add();
}).CellSave("calcTotal").Locale("en-ZA").GridLines(Syncfusion.EJ2.Grids.GridLine.Both).EnableAltRow(true).Load("load").Height("400px").EditSettings(edit => { edit.AllowEditing(true).AllowAdding(false).AllowDeleting(false).Mode(Syncfusion.EJ2.Grids.EditMode.Batch).ShowConfirmDialog(false); }).Toolbar(new List<string>() { "Search" }).ActionBegin("actionBegin").ActionComplete("actionComplete").Aggregates(agg =>
{ agg.Columns(new List<Syncfusion.EJ2.Grids.GridAggregateColumn>() { new Syncfusion.EJ2.Grids.GridAggregateColumn() { Field = "LineTotal", Format = "C2", Type = "Sum", FooterTemplate = "Excl Total: ${Sum}" } }).Add();
//agg.Columns(new List<Syncfusion.EJ2.Grids.GridAggregateColumn>() { new Syncfusion.EJ2.Grids.GridAggregateColumn() { Field = "LineTotal", Format = "C2", Type = "Custom", FooterTemplate = "VAT: ${Custom}", CustomAggregate = "vatFn" } }).Add();
//agg.Columns(new List<Syncfusion.EJ2.Grids.GridAggregateColumn>() { new Syncfusion.EJ2.Grids.GridAggregateColumn() { Field = "LineTotal", Format = "C2", Type = "Custom", FooterTemplate = "Total: ${Custom}", CustomAggregate = "totalFn" } }).Add();
}).BeforeBatchSave("btchSave").DataBound("calcAggs").Render()
</div>
<style>
.image img {
height: 60px;
width: 60px;
border-radius: 10px;
box-shadow: inset 0 0 1px #e0e0e0, inset 0 0 14px rgba(0, 0, 0, 0.2);
}
.e-grid .e-altrow {
background-color: lightgrey !important;
}
.content-wrapper {
width: 35%;
margin: 0 auto;
min-width: 185px;
}
.e-float-input.e-numeric.e-input-group {
margin-top: 40px;
}
.control-label {
padding: 24px 0px 10px 0px;
font-size: 12px;
}
.e-input-group .e-input-group-icon, .e-input-group.e-control-wrapper .e-input-group-icon {
margin-bottom: 0px;
margin-right: 0px;
margin-top: 0px;
}
</style>
5) Share the Edge browser version.
Version 97.0.1072.76 (Official build) (64-bit)
Hi,
In your sample i am unable to reproduce the problem. You sample is using Nuget package version 19.1.0.55.
I get the same problems in Firefox. The grid does not render correctly. The search bar disappears and I cannot edit any rows. Inspection console windows also shows similar errors to the errors in Edge
|
Layouts.cshtml
@* Syncfusion Essential JS 2 Styles *@
@* Syncfusion Essential JS 2 Scripts *@
|
Hi,
I played around a bit more and found the following issues:
Nevermind... Point 2 does work in Firefox too
As you can see, the grid feature needs some prefix in order to work in every browser. This tool will help you to prefix your CSS Just copy/paste your CSS in and get the result, your code will now work for IE. You don't need prefixes for CSS Grid to work in Edge
Regards