Grid inside dialog problem.

Hi, I'm having the following problem.

When the grid component is inside a dialog, and its height is set to 100%, then it overflows the parent element generating an undesirable scroll bar.

Here is the code that demonstrates it.


Obs: If I render the grid after the dialog is open, then its height is calculated correctly.

How can I fix this?

Regards,
Wendell Gasparoni.

5 Replies 1 reply marked as answer

AG Ajith Govarthan Syncfusion Team June 26, 2020 01:21 PM UTC

Hi Wendell, 

Thanks for contacting Syncfusion support. 

We have checked the attached sample and able to reproduce the reported behavior at our end. To overcome the grid content you can set width as auto for the grid component which will not overflow the grid.  

For your convenience we have attached the sample so please refer the sample for your reference. 


Please get back to us if you need further assistance. 

Regards, 
Ajith G. 



WG Wendell Gasparoni July 3, 2020 08:21 PM UTC

Hi, this solution works partially, but the first example was a simplified one. I updated the code to represents a more real situation.


New example: https://stackblitz.com/edit/angular-jjtos2?file=app.component.html


The following problems realize with your solution:


1) The scrollbar will show up as soon as the content increase, and this scrollbar will be in the dialog and not in the grid component (we can manage this with "css flexbox" but yet has a second problem).

2) When the user removes any item from the grid, the confirm dialog is reduced in size, and the text cannot be read.


How can it be solved?


Regards,

Wendell Gasparoni.



AG Ajith Govarthan Syncfusion Team July 6, 2020 12:53 PM UTC

Hi Wendell, 

Thanks for the update. 

Based on your requirement you have mentioned that you are facing scroller issue and also the confirm dialog content is not shown properly when you delete row. To overcome these issues you can use the *ngIf property to render the grid after rendering of the dialog component. 

So which will render the grid component with proper height and there will not be any additional scrollers.  Since Dialog and Grid are different components you can also set grid width based on the dialog component width to overcome the issue. 


Please get back to us if you need further assistance. 

Regards, 
Ajith G. 


Marked as answer

WG Wendell Gasparoni July 11, 2020 08:14 PM UTC

Ok, thank you.


AG Ajith Govarthan Syncfusion Team July 13, 2020 12:44 PM UTC

Hi Wendell, 

Thanks for the update. 

Please get back to us if you need any further assistance. 

Regards, 
Ajith G. 


Loader.
Up arrow icon