- Home
- Forum
- ASP.NET MVC
- Save and restore column width (ejGrid EJ1)
Save and restore column width (ejGrid EJ1)
Hi,
very simple question.
Is it possible include column width into persistence feature??i'm using ASP.NET MVC and EJ1
regards
alessandro
SIGN IN To post a reply.
5 Replies
1 reply marked as answer
PK
Padmavathy Kamalanathan
Syncfusion Team
June 15, 2020 01:35 PM UTC
Hi Alessandro,
Thanks for contacting Syncfusion Support.
QUERY: Is it possible to include column width in to persistence
In Grid, when we enable the persistence property, column properties will be persisted by default. From the columns properties, you can access the width of specific column.
Please check the below code,
@Html.EJ().Button("buttonnormal").Size(ButtonSize.Normal).Text("Button")
.ClientSideEvents(e => e.Click("Click"))
@(Html.EJ().Grid<object>("Grid").Datasource((IEnumerable<object>)ViewBag.data)
.AllowPaging().EnablePersistence(true)
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").Add();
col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add();
}))
<script type="text/javascript">
function Click(args) {
var gridobj = $("#Grid").ejGrid("instance");
//grid instance
gridobj.model.columns[1].width = 100;
//changing width of column
var columns = gridobj.model.columns[1];
gridobj.columns(columns);
//pushing the new column value
}
</script> |
In the above example, we have enabled persistence and we have modified the width of column using the "columns" method in the button click. When we refresh the page and check the local storage, the modified width will be available in the models of the grid.
Please check the below screenshot,
Please check the below help documentation,
If you still face issue, kindly get back to us with the below details,
- Complete Grid rendering code (both client and server end)
- Please share us your Essential Studio version details
- Share us video demonstrating the issue
- Screenshot of error with stack trace (if any)
Regards,
Padmavathy Kamalanathan
AD
Alessandro Degola
June 16, 2020 07:24 PM UTC

-----------------------------------------------------------------------------------

-----------------------------------------------------------------------------------

video
AD
Alessandro Degola
June 17, 2020 05:04 PM UTC
up, any idea???
PK
Padmavathy Kamalanathan
Syncfusion Team
June 18, 2020 12:01 PM UTC
Hi Alessandro,
Thanks for your update.
We are able to reproduce the reported issue at our end. We have logged it as issue and fix for this issue will be rolled out in our Volume 2 2020 release at the end of June 2020. Until then we appreciate your patience.
You can track the current status of your request, review the resolution timeline and contact us for any further inquiries through this link,
Note: To view the above feedback, kindly login into your account.
Kindly get back to us for further assistance.
Regards,
Padmavathy Kamalanathan
PK
Padmavathy Kamalanathan
Syncfusion Team
July 15, 2020 03:15 PM UTC
Hi Alessandro,
Thanks for your patience.
We are glad to announce that fix for the issue "Column Width does not persist with enable Persistence" has been rolled out in our weekly nuget release. We request you to update to our latest version "18.2.0.45".
Regards,
Padmavathy Kamalanathan
Marked as answer
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
- Marked answer
-
AD Alessandro Degola
- Jun 14, 2020 07:45 AM UTC
- Jul 15, 2020 03:15 PM UTC