Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / Igx-Grid scroll bar is not coming

Igx-Grid scroll bar is not coming

New Discussion
Vignesh Kumar A
Vignesh Kumar A asked on Jan 10, 2024 11:39 AM

I am using angular infragistics^17.0.2 for my application and its having strange behavior. I have Igx-grid in my page and it has width 266px but still scroll bar is not coming at any cost but if i open any popup and close it out, the scroll bar is coming. I don't know what causing it. I have tried all workaround to set scroll bar explicitly but it has no fixed header and after open-close popup one more scroll bar is coming.

Can you please help me to fix this issue.

Note: it was working fine with previous version(11) but not in current version.

<div class="col-12 p-1 flex-column first_child flexContent1">
        <div class="location-grid">
          <igx-grid #ClearanceLocationGrid
                    id="ClearanceLocationGrid"
                    [autoGenerate]="false"
                    [data]="validatedLocations"
                    [rowSelection]="'multiple'"
                    (rowSelectionChanging)="onLocationGridRowSelectionChange($event)"
                    displayDensity="compact"
                    class="locationGridClass"
                    [primaryKey]="'locationStagingGuid'"
                    [isLoading]="loaderStatus$ | async"
                    (columnInit)="onColumnInit($event)">
            <igx-column header="Is Cleared?" field="isCleared" width="100">
              <ng-template igxCell let-cell="cell" let-value>
                <igx-checkbox [checked]="cell.row.data.isCleared" [disabled]="true"> </igx-checkbox>
              </ng-template>
            </igx-column>
            <igx-column header="Key" field="isPrimary" width="50">
              <ng-template igxCell let-cell="cell" let-value>
                <igx-checkbox [checked]="value" (change)="onLocationGridPrimaryKeyChange($event, cell)"> </igx-checkbox>
              </ng-template>
            </igx-column>
            <igx-column header="Address" width="1300" field="streetAddress">
              <ng-template igxCell let-cell="cell">
                <span *ngIf="cell.row.data.streetAddress !== null"> {{ cell.row.data.streetAddress }}, </span>
                <span *ngIf="cell.row.data.city !== null"> &nbsp;{{ cell.row.data.city }}, </span>
                <span *ngIf="cell.row.data.state !== null"> &nbsp;{{ cell.row.data.state }}, </span>
                <span *ngIf="cell.row.data.zip !== null"> &nbsp;{{ cell.row.data.zip }} </span>
              </ng-template>
            </igx-column>
            <igx-column header="TIV" field="tiv" width="250" dataType="number"> </igx-column>
          </igx-grid>
        </div>
      </div>
Sign In to post a reply

Replies

  • 0
    Riva Ivanova
    Riva Ivanova answered on Dec 19, 2023 4:14 PM

    Hello Vignesh,

    Thank you for posting in our community!

    I have been looking into your question and what I can say, as mentioned in our Sizing topic here, is that a horizontal scrollbar will be rendered if the combined width of all columns is bigger than the actual IgxGrid width.

    From the provided code snippet I can see that the combined width of the columns equals 1700px (100 + 50 + 1300 + 250), however, the IgxGrid width is not set which means that it will default to 100% and will try to fill the available space as per our documentation here. Additionally, as mentioned in our Percentages section here, if we set the grid width input to 100% and there is no parent element it will fill 100% of the available width of the browser window.

    Having this in mind, if the <div class="col-12 p-1 flex-column first_child flexContent1"> or <div class="location-grid"> do not have a width CSS property set to a value less than 1700px (the combined width of the columns) and the browser window is greater than 1700px, then it is expected that no horizontal scrollbar is rendered.

    Here could be found a small sample where I have placed the IgxGrid in a parent div element which has width and height set to 500px. The IgxGrid itself does not have any width or height set and will size relative to the parent div element which means that the final width and height of the grid will be 500px.

    Additionally, the combined width of the columns is 1100px which exceeds the width of the IgxGrid (500px) and results in a horizontal scrollbar being rendered.

    Please test it on your side and let me know how it behaves.

    To conclude, as the isolated sample seems to be working correctly and both horizontal and vertical scrollbars are rendered, it is hard to tell what the possible reason for this behavior might be.

    Having this in mind, in order to assist you further, it would be helpful if you could provide me with a small sample that demonstrates the behavior on your side. Also, if possible, it would be great if you could try and modify the provided by me sample, so it reproduces the issue.

    Alternatively, if the behavior cannot be replicated, please feel free to provide your own sample. Remove any external dependencies and code that are not directly related to the issue, zip your application, and attach it in this forum thread.

    Thank you for your cooperation. Looking forward to your reply.

    Sincerely,
    Riva Ivanova
    Associate Software Developer

    • 0
      Vignesh Kumar A
      Vignesh Kumar A answered on Dec 19, 2023 6:04 PM

      Hi Riva,

      I am talking about vertical scroll bar and horizontal one is working fine. Only problem with vertical scroll bar

      • 0
        Riva Ivanova
        Riva Ivanova answered on Dec 20, 2023 8:46 AM

        Hello Vignesh,

        Thank you for your clarifications!

        Regarding rendering a vertical scrollbar when the IgxGrid height is not set explicitly (meaning that it defaults to 100%), as mentioned in our Sizing topic here:

        When the height input is set to percentages the IgxGrid will size based on the parent element height. If the parent element has its height set in pixels or percentages, the grid will size relative to the size of the parent.

        When the parent element does not have defined height, the browser does not assign height to it initially and sizes it based on its children and their size. That is why there is no way for the grid to know what base height to use in order to apply percentage sizing based on it. For this reason, it will render a maximum of 10 rows and if there are more rows, a vertical scrollbar will be rendered. Otherwise, the grid will fit to the number of rendered rows.

        Also, the size of the data chunks is also determined by the row height for the vertical (row) virtualization (reference).

        Having this in mind, if the IgxGrid has enough data chunks to fit the available space and exceed it, then a vertical scrollbar will be rendered as could be observed in the previously attached sample.

        Additionally, I would suggest referring to our Sizing and Virtualization topics as they provide a detailed explanation along with examples demonstrating how the horizontal and vertical virtualization is enabled.

        To conclude, as I not sure of the overall configuration of your application, if any custom styling regarding the height is applied, what is the data structure, etc., and the isolated sample seems to work as expected, this may indicate that the described behavior is local to your own project configuration and environment.

        Nevertheless, it is hard to provide any suggestion as the behavior is not reproducible on my side and in order to assist you further, I would encourage you to try and reproduce this behavior in a small working sample.

        This would be the best approach to investigating this matter further in a timely manner.

        Sincerely,
        Riva Ivanova
        Associate Software Developer

  • 0
    Warren Lambert
    Warren Lambert answered on Jan 10, 2024 11:39 AM

    All good now?

  • 0
    Anderson Smith
    Anderson Smith answered on Oct 26, 2026 7:33 AM

    The Rice Purity Test is a self-assessment questionnaire that measures a person’s life experiences and innocence level. It originally started among college students as a fun way to compare experiences related to relationships, habits, and personal choices.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Vignesh Kumar A
Favorites
0
Replies
5
Created On
Jan 10, 2024
Last Post
12 hours, 16 minutes ago

Suggested Discussions

Created by

Created on

Jan 10, 2024 11:39 AM

Last activity on

Jan 10, 2024 11:39 AM