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

how to show child grid height completely from main grid automatically or programatically

Hi, I have a problem on showing full height of child grid from main grid. (Main grid has an expand icon to expand the child grid)

initially, when page loading, it expands the child grid, but the height is not the exact necessary height. so, it does not show full height of the child grid.

.e-grid {
        overflow-y:auto !important;
        min-height:200px;        
    }

as this example,  I give minimum height, but this is not a solution.

some strange thing is that if I manually click/unclick the expand icon, it shows the full height of child grid.

I'd like to know how to give full height of child grid programatically or automatic the main grid's record's expand icon clicking.

Thank you in advance.

any solutions are welcome!
Kind Regards

4 Replies

DS Dongil Shin July 13, 2017 02:53 AM UTC

I attached this issue with screenshots.

Thank you.

Kind Regards,


Attachment: does_not_show_full_height_child_grid_issue_a19c4841.zip


FS Farveen Sulthana Thameeztheen Basha Syncfusion Team July 13, 2017 04:35 PM UTC

Hi Dongil, 

Thanks for contacting Syncfusion Support. 

We have checked your issue and prepared sample according to that but we are unable to reproduce your reported problem “Child Grid height doesn’t set properly” at our end . In this sample we have rendered hierarchical Grid inside the Tab. Please refer to the sample:- 


So we need additional information to find the cause of the issue. Could you please share following details with us. 

1. Grid code example (both in server and client side). 

2. Did you have customized the Grid height. If so please share the code. 

3. An issue reproducing sample if possible or sample hosted link or replicate the issue on the above sample. 
 
4. Essential studio version and browser details. 

The provided information will help us to analyze and provide you the solution as early as possible. 
 
Regards, 
 
Farveen sulthana T 




DS Dongil Shin July 14, 2017 04:41 AM UTC

Hi, Thank you for your quick response.

I attached our current source code, the structure is that the Edit.cshtml includes as a partial view with _StarGrid which has Syncfusion grid.

the stargrid.js includes all related events in Main grid and Child grid.

however, the core logic for showing grid is in _StarGrid.cshtml.

<style>
    /* Force width of validation so the message is not truncated */
    .e-field-validation-error {
        width: 113px;
    }

    .e-rowcell {       
        word-wrap:break-word !important;
    }

    .e-grid {
        overflow-y:auto !important;
        min-height:200px;          
    }        
</style>
<script>
    setTimeout(function () {
        var height = $('.e-detailrow:visible').height();
        //console.log(height);
        if (height > 200) // default is 200px, if height is bigger than, then apply it.
        {
            $(".e-grid").css("min-height", height + "px");
            $("#StarGrid").ejGrid("collapseAll");
            $("#StarGrid").ejGrid("expandAll");
        }
    }, 1000);

</script>

this code works, with this code, it can show the full height of child grid of #StarGrid.

however as you can see, I just use setTimeOut and set height and then collapse then expand, it works.

but there may be a better solution, I think so.

Please give me a response soon.

Thank you.

Kind Regards,


Attachment: stargrid_57bbd03b.zip


FS Farveen Sulthana Thameeztheen Basha Syncfusion Team July 17, 2017 05:03 PM UTC

Hi Dongil,  
 
We  have checked your code example and prepared sample according to that but we are unable to reproduce your reported problem at our end. Please check the sample. 


Could you please make ensure that AllowScrolling property  has been enabled for both child and parentGrid. After following the code example in the sample, still facing difficulties, please share us the following details with us. 

1. Screenshot/Video demo to replicate the issue. 

2.If possible, provide an issue reproducing sample or hosted link or replicate the issue in the provided sample.  
 
3. Confirm the version of Essential Studio (15.2.0.46). 

4. Exact scenario you are facing the issue. 

The provided information will help us to analyze and provide you the solution as early as possible. 
 
Regards, 

Farveen sulthana T 


Loader.
Up arrow icon