Hi Arun,
Thanks for contacting Syncfusion support.
We have achieved your requirement using ActionComplete , DataBound event and setDimension method in Grid. In data bound event we can get the initial grid height and it stored into the global variable.
In action complete event we can set the Grid initial height after filtering. Please refer to the code example, sample and Help document,
Code example:
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowPaging() /*Paging Enabled*/
.SelectionType(SelectionType.Single)
.AllowResizing()
.AllowFiltering()
.ClientSideEvents(e => e.DataBound("dataBound").ActionComplete("actionComplete"))
.Columns(col =>
{
. . .
}))
</div>
<DataBound event>
function dataBound(e) {
initialHeight = this.element.height();// Get the initialHeight when Grid first rendering
}
<Actionomplete event>
function actionComplete(e) {
if (e.requestType == "filtering")
this.setDimension(initialHeight); //Set the initial height after filtering
}
|
Help documents:
Regards,
Venkatesh Ayothiraman.