Hi Bradley,
Query :- how to set the searchsettings on a grid.
You can give the fieldNames and Key value that you are going to be search on the Fields using Field and Key property of the searchSettings. Please refer to the API link:-
Refer to the code example:-
|
<div class="col-md-12">
@(Html.EJ().Grid<UserModel>("MyGrid")
.Datasource(ds => ds.Json(Model.ToList()).CrossDomain(true).RemoveURL(Url.Action("Remove", "Home")).UpdateURL(Url.Action("ToggleManager", "Home")).Adaptor(AdaptorType.RemoteSaveAdaptor))
.AllowSearching()
.SearchSettings(search =>
{
search.Fields(field =>
{
field.Add("UserID");
field.Add("UserName");
});
search.Key("Alex");
})
.Columns(col =>
{
col.Field("UserID").Visible(false).IsPrimaryKey(true).Add();
col.Field("UserName").HeaderText("Worker's full name").TextAlign(TextAlign.Left).Width(20).Add();
})
)
</div> |
Please get back to us if you need any further assistance.
Regards,
Farveen sulthana T