Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1415
Hide/show/disable rowselectors in Igx Hierarichal grid load on demand
posted

Hi Team,

Using 9.1.28 version of Infragistics Hierarichal grid load on demand.

Requirement: I have rowSelectors in the child grid of Hierarichal Grid and a button in the Toolbar of the child Grid.

I want to show/hide the row selectors and also disable row selection for the rows whose row selector is hidden.

HTML
Parent Grid:

          <igx-hierarchical-grid #grid1 [data]="srcData" [autoGenerate]="false" [primaryKey]="'OrderID'" [columnWidth]='"70px"'
            [allowFiltering]='true' [height]="null" [width]="'100%'" [rowHeight]="'50px'" [showToolbar]="true" [paging]="false" [perPage]="200"
            [emptyGridMessage]="emptyMessage" [isLoading]="gridLoading" [filterMode]="'excelStyleFilter'" [displayDensity]="'compact'" (onRowToggle)="rowToggle($event)">
Child Grid:

<igx-row-island #childGrid  [autoGenerate]="false" [allowFiltering]='true' [filterMode]="'excelStyleFilter'" [primaryKey]="'customerId'" [autoGenerate]="false" cellSelection="none"
            (onGridCreated)="gridCreated($event)" (onGridInitialised)="loadCustomerDetails($event)" [rowSelection]="'multiple'" [showToolbar]="true" [hideRowSelectors]="hideRowSelectors"
            [width]='"1200px"' [columnWidth]='"180px"' (onRowSelectionChange)="handleRowSelectionChange($event)">

TS:
Default all rows are selected and once we un-select and select first 2 rows in the child Grid and click a button, the selected row's row selectors should hide and if i relaod the page, and expand same parent ID, by default first 2 rows should be unselected and in read-only mode. Also the button in toolbar should be disabled.

Please help me to achieve.

P.S: i cannot use onRowSelectionChange() event bcz the child grid created only once and later it shows the cache version which messes up my validation. 

Please reply ASAP.


  • 2680
    Offline posted

    Hello,

    The Hierarchical Grid Row Selection Example shows how the hideRowSelectors property can be dynamically toggled, as you are probably already familiar with. This property also exists in version 9.1.28. However, it controls the row selectors visibility for the entire row island, so I do not believe it is possible to have them visible on some rows and hidden on others through this property, if I understand the requirement correctly.

    The mentioned button’s disabled state could also be set via property binding to a flag pointing when it should be disabled.

    About saving the selection on reload, it is one of the features available on the IgxGridState directive, so please, refer to the State Persistence topic.

    Having in mind that the described scenario is unclear, please fork and modify any the referenced topics demos to illustrate your point.

    Best regards,

    Bozhidara Pachilova