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
590
Facing issue in active row
posted

Hi

I want a small clarification on one of the use case related to IgrDataGrid (https://ko.infragistics.com/products/ignite-ui-react/react/components/grids/data-grid/overview).

I have used IgrDataGrid, in that  if we select any row with country USA and then apply filter on country column and removed data for USA. then that selected row for USA is not visible now on grid so we want that it should not be active.  

So, for this I need to know how can we achieve that , If there is any solution for this please suggest  as I need to implement this in my IgrDataGrid.   

Hoping for a positive response.

Thanks!!!

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Shubham,

    I have been investigating into the behavior you are reporting, and it appears that the activeCell of the grid should not remain for a row or cells that are filtered out. The selection can remain through the filter though.

    In order to prevent a selection remaining on a row that is filtered out, you can check the grid’s actualDataSource property with the method indexOfItem. This method will return -1 for rows that are filtered out. If you find that this is the case, you can remove the item from the selectedItems collection of the grid. Therefore, you can remove items from the selection of the grid using the following code:

    let item = this.grid.selectedItems.item(0);
    let index = this.grid.actualDataSource.indexOfItem(item);           

    if(index < 0){
        this.grid.selectedItems.remove(item);
    }

    I hope this helps. Please let me know if you have any other questions or concerns on this matter.

Children