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.
Unfortunately, activation email could not send to your email. Please try again.

ejGrid Height

Thread ID:

Created:

Updated:

Platform:

Replies:

125988 Sep 15,2016 05:25 PM Sep 16,2016 03:54 AM ASP.NET MVC 1
loading
Tags: Grid
Arun Gandhi
Asked On September 15, 2016 05:25 PM

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


Venkatesh Ayothi Raman [Syncfusion]
Replied On September 16, 2016 03:54 AM

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.  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;