We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ejGrid Height

Hello,

How can set minimum height for ejGrid. My issue is when I filter record, the grid height shrinks. I want to keep it same as original.

Thanks


1 Reply

VA Venkatesh Ayothi Raman Syncfusion Team September 16, 2016 07:54 AM UTC

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.  


Loader.
Live Chat Icon For mobile
Up arrow icon