Hi Arun,
Thanks for contacting Syncfusion support.
If you want to change the column width dynamically, use columns method of ejGrid. In this sample we change the column width of an particular column in the button click.
Find the code example and sample:
@Html.EJ().Button("buttonnormal").Size(ButtonSize.Normal).Text("Button").ClientSideEvents(e => e.Click("Click"))
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); })
------------------
.AllowPaging()
.Columns(col =>
{
---------------------------------
col.Field("ShipCity").HeaderText("Ship City").TextAlign(TextAlign.Right).Width(80).Priority(2).EditType(EditingType.Dropdown).ValidationRules(v => v.AddRule("required", true)).Add();
------------------------------------
})
)
----------------------------------------------
function Click(args) {
var gridobj = $("#FlatGrid").ejGrid("instance");
gridobj.model.columns[1].width = 100;
var columns = gridobj.model.columns[1];
gridobj.columns(columns);
} |
Refer to the Help document for the columns method.
Regards,
Prasanna Kumar N.S.V