Hi Sietse,
Thanks for contacting Syncfusion support.
We have analyzed your query and we suspect that the mentioned issue occurs due to the column details defined as an object in columns method of ejGrid.
So, we suggest you to pass the column details as an array of object.
Please refer the below code example.
|
@Html.EJ().Button("Add").Size(ButtonSize.Large).ShowRoundedCorner(true).Text("Add Column").ClientSideEvents(eve => eve.Click("Addcolumn"))
@(Html.EJ().Grid<object>("Editing")
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).IsIdentity(true).Width(50).Add();
col.Field("EmployeeID").HeaderText("Employee ID").Width(50).Add();
col.Field("ShipCity").HeaderText("ShipCity").Width(50).Add();
})
)
<script>
function Addcolumn() {
var obj = $(".e-grid").ejGrid("instance");
obj.columns([{ field: "CustomerID", headerText: "CustomerID", width: 80 }], "add")
obj.refreshContent(true);
}
</script> |
Please refer the below link for details of columns method.
If you need any further assistance please get back to us.
Regards,
Sathyanarayanamoorthy