igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Need a scroll bar for igx-hierarchical-grid

Open SaranyaDwarampudi opened this issue 7 years ago • 12 comments

Hello, Can you please provide me a scroll bar vertically and horizontally for igx-hierarchical-grid.

Thanks

SaranyaDwarampudi avatar Apr 22 '19 09:04 SaranyaDwarampudi

@SaranyaDwarampudi could you please provide more details on what do you exactly need, you need a scroll for the child grids or something else ?

SlavUI avatar Apr 22 '19 11:04 SlavUI

Grid Please look at the screenshot i have provided. I have placed the igx-hierarchical-grid in a div and i have added a scroll bar to the grid. In the same way i need a scroll bar directly for the igx-hierarchical-grid. A single scroll bar vertical and horizontal for the entire grid. Thanks

SaranyaDwarampudi avatar Apr 22 '19 12:04 SaranyaDwarampudi

@SaranyaDwarampudi Did you set height of the grid? Can you share the grid configuration, please.

mpavlinov avatar Apr 22 '19 14:04 mpavlinov

brandview.zip Please find the attatchment.

SaranyaDwarampudi avatar Apr 23 '19 05:04 SaranyaDwarampudi

@SaranyaDwarampudi , if you want to have a scrollbar for the hierarchical grid itself you should set its height to something different than 'null' (as it is in your application). For example you can set it to '100%' so that it has the height of your outer div.

ChronosSF avatar Apr 24 '19 10:04 ChronosSF

@ChronosSF As you said i have removed the div and changed the height to 100%,Please look into the attatchments below. GridWithHeight2 GridWithHeight

Initially it was showing a single row and i want the grid to be displayed fully even if there is no data. And a horizontal scroll bar is coming only at the child grid, i want a horizontal scroll bar at a parent grid level and the scrolling must happen at all the grids. There was no vertical scroll bar coming .

SaranyaDwarampudi avatar Apr 25 '19 05:04 SaranyaDwarampudi

@SaranyaDwarampudi In the configuration you have sent the grid width value is bigger than the container's width which makes the vertical scrollbar to not be visible if it is not scrolled to the most rightmost. Try setting of the width of hierarchical grid to 100%. Also set the height to be 100% so that no horizontal scrollbar of the container appears. Also add the div container as in the configuration. This should get the grid to display with both horizontal and vertical grid inside the container.

<div style='width:1200px;height:500px; overflow:auto;border:1px solid black;margin-left: 20px;margin-top: 20px;'>
<igx-hierarchical-grid class="hierarchicalGrid"  (onSortingDone)="sortingDone($event)" (onColumnInit)="onColumnInit($event)" [data]="totalcategories_bv"  [autoGenerate]="false" 
    [width]="'100%'" [height]="'100%'" [paging]="false" [perPage]="10"  #hierarchicalGrid2>

MartinKamenov avatar Apr 25 '19 11:04 MartinKamenov

@MartinKamenov I want to remove the div, the scroll bar is coming on the div. I need a scroll bar for the grid and when i make the height and width to 100%, the result is- please look into the above comment and screenshots in the above comment.

SaranyaDwarampudi avatar Apr 25 '19 12:04 SaranyaDwarampudi

@SaranyaDwarampudi If you remove the container you can get the grid to have vertical scrollbar by setting the height to be smaller than the sum of the rows and it should have fixed value(in pixels). The width should be smaller than the screen width so you could see the grid’s vertical scrollbar.

Please check the attached sample. brandview-sample.zip

MartinKamenov avatar Apr 25 '19 13:04 MartinKamenov

@MartinKamenov I have made the changes as you said, but i have also got horizontal scroll bar for parent grid as well as child grid, Please refer to the attatchment. I need only one horizontal scroll bar for the entire grid and i dont want any horizontal scroll bar for child grids HorizontalScroll

SaranyaDwarampudi avatar Apr 29 '19 09:04 SaranyaDwarampudi

@SaranyaDwarampudi Let me know if I understood your issue correctly. You have a HierrarchicalGrid where the child grid is configured to have bigger width than the parent (either it has bigger width set or it has columns that do not fit in the viewport). For example: <igx-hierarchical-grid #hGrid [data]="localData" [autoGenerate]="false" [height]="'600px'" [width]="'1000px'" [columnWidth]='"500px"'> … <igx-row-island [key]="'Albums'" [autoGenerate]="false" [width]='"1500px"' [columnWidth]='"300px"'> …

In this scenario by design the child grid will display a scrollbar, which allows scrolling the content of the child grid that is not currently visible: image

Based on your screenshots it appears that you would like to have an option that allows to remove the child grid scrollbar and to allow the parent grid scrollbar to scroll the child columns that are not currently visible. Let me know if this is correct.

MayaKirova avatar Jun 10 '19 14:06 MayaKirova

@SaranyaDwarampudi Where you able to achieve what you're looking for?

mpavlinov avatar Jun 26 '19 06:06 mpavlinov