Hi,
I am facing two problems in the grid working in the frozen column.
1. Row height is not equal when I am using the "Column Chooser" option for the column show/hide.
2. The grid header also hides in the same case but when clicking on the refresh button everything gets OK.
Please keep in mind I am using frozen columns.
Video and code are attached please check.
Thank you.
Grid row height and header issue
|
Index.cshtml
<div class="control-section">
@{
List<object> commands = new List<object>();
commands.Add(new { type = "Edit", buttonOption = new { iconCss = "e-icons e-edit", cssClass = "e-flat" } });
commands.Add(new { type = "Delete", buttonOption = new { iconCss = "e-icons e-delete", cssClass = "e-flat" } });
commands.Add(new { type = "Save", buttonOption = new { iconCss = "e-icons e-update", cssClass = "e-flat" } });
commands.Add(new { type = "Cancel", buttonOption = new { iconCss = "e-icons e-cancel-icon", cssClass = "e-flat" } });
}
@Html.EJS().Grid("DefaultPaging").ShowColumnChooser(true).DataSource((IEnumerable<object>
)ViewBag.datasource).Columns(col =>
{
col.HeaderText("Manage Records").IsFrozen(true).Width("160").Commands(commands).Add();
col.Field("OrderID").HeaderText("Order ID").Width("120").IsPrimaryKey(true).Filter(new { type = "CheckBox" }).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("CustomerID").IsFrozen(true).HeaderTemplate("#employeetemplate").HeaderText("Customer Name").Width("170").Add();
col.Field("OrderDate").HeaderTemplate("#datetemplate").HeaderText("Order Date").Width("130").EditType("datepickeredit").Format("yMd").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("Freight").IsFrozen(true).Template("#template").HeaderText("Freight").Width("120").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("ShipCountry").Width("150").Add();
col.Field("ShipCity").Template("#template1").Add();
}).Height("400").AllowGrouping().AllowPaging().Toolbar(new List<string>
() { "Add", "Edit", "Delete", "Cancel", "ColumnChooser" }).AllowFiltering().FilterSettings(filter => filter.Type(Syncfusion.EJ2.Grids.FilterType.Menu)).EditSettings(edit => { edit.AllowEditing(true).AllowAdding(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Batch); }).Render()
</div>
<script id="template" type="text/x-template">
<div class="template_checkbox">
${if(Freight < 13)}
<input type="checkbox" checked> ${else}
<input type="checkbox"> ${/if}
</div>
</script>
<script id="template1" type="text/x-template">
<div class="template_checkbox">
<button>${ShipCity}</button>
</div>
</script>
<script id="datetemplate" type="text/x-template">
<span class="e-icon-calender e-icons headericon"></span> Order Date
</script>
<script id="employeetemplate" type="text/x-template">
<span class="e-icon-userlogin e-icons employee"></span> Emp ID
</script>
<script>
var initial = true;
</script> |
Hi,
I think our understanding is not the same on these points.
1. Row height is not equal when I am using the "Column Chooser" option for the column show/hide, with freeze columns.
2. The grid columns header hides when is "Column Chooser" option for the column show/hide again, with freeze columns.
The code and snapshot is attached.
|
Index.cshtml
@using Syncfusion.EJ2;
@using Syncfusion.EJ2.Navigations;
@{
ViewBag.Title = "Grid UrlAdaptor";
}
@{
List<object> commands = new List<object>();
commands.Add(new { type = "Edit", buttonOption = new { iconCss = "e-icons e-edit", cssClass = "e-flat" } });
commands.Add(new { type = "Delete", buttonOption = new { iconCss = "e-icons e-delete", cssClass = "e-flat" } });
commands.Add(new { type = "Save", buttonOption = new { iconCss = "e-icons e-update", cssClass = "e-flat" } });
commands.Add(new { type = "Cancel", buttonOption = new { iconCss = "e-icons e-cancel-icon", cssClass = "e-flat" } });
}
<div class="e-sample-resize-container">
@Html.EJS().Tab("ej2Tab").Items(new List<TabTabItem>{
new TabTabItem { Header = new TabHeader { Text = "Grid_1" }, Content = "#Grid1" },
new TabTabItem { Header = new TabHeader { Text = "FaceBook" }, Content = "#Grid2" }
}).Render()
</div>
<div id="Grid1" style="display: none">
@Html.EJS().Grid("DefaultPaging").ShowColumnChooser(true).AllowTextWrap().DataSource(ds => ds.Url("/Home/UrlDatasource").Adaptor("UrlAdaptor").InsertUrl("/Home/Insert").RemoveUrl("/Home/Remove").UpdateUrl("/Home/Update")).Columns(col =>
{
col.HeaderText("Manage Records").IsFrozen(true).Width("160").Commands(commands).Add();
col.Field("OrderID").HeaderText("Order ID").Width("120").IsPrimaryKey(true).Filter(new { type = "CheckBox" }).TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.IsFrozen(true).HeaderTemplate("#headtemplate").Template("#template").HeaderText("Customer Template").Width("170").Add();
col.Field("CustomerID").IsFrozen(true).HeaderTemplate("#employeetemplate").HeaderText("Customer Name").Width("170").Add();
col.Field("OrderDate").HeaderTemplate("#datetemplate").HeaderText("Order Date").Width("130").EditType("datepickeredit").Format("yMd").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("Freight").Template("#template").HeaderText("Freight").Width("120").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("ShipCountry").Width("150").Add();
col.Field("ShipCity").Template("#template1").Add();
}).Height("400").AllowGrouping().AllowPaging().Toolbar(new List<string>
() { "Add", "Edit", "Delete", "Cancel", "ColumnChooser" }).AllowFiltering().FilterSettings(filter => filter.Type(Syncfusion.EJ2.Grids.FilterType.Menu)).EditSettings(edit => { edit.AllowEditing(true).AllowAdding(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Batch); }).Render()
</div>
<div id="Grid2" style="display: none">
Facebook is an online social networking service headquartered in Menlo Park, California. Its website was launched on February 4, 2004, by Mark Zuckerberg with his Harvard College roommates and fellow students Eduardo Saverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes.The founders had initially limited the website's membership to Harvard students, but later expanded it to colleges in the Boston area, the Ivy League, and Stanford University. It gradually added support for students at various other universities and later to high-school students.
</div>
<script id="template" type="text/x-template">
<div class="template_checkbox">
${if(Freight < 13)}
<input type="checkbox" checked> ${else}
<input type="checkbox"> ${/if}
</div>
</script>
<script id="template1" type="text/x-template">
<div class="template_checkbox">
<button>${ShipCity}</button>
</div>
</script>
<script id="datetemplate" type="text/x-template">
<span class="e-icon-calender e-icons headericon"></span> Order Date
</script>
<script id="employeetemplate" type="text/x-template">
<span class="e-icon-userlogin e-icons employee"></span> Customer ID
</script>
<script id="headtemplate" type="text/x-template">
<span class="e-icon-userlogin e-icons employee"></span> template data
</script>
<script>
var initial = true;
</script> |