Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / Hide Specific Rows in IgxGrid While Keeping Group Summaries

Hide Specific Rows in IgxGrid While Keeping Group Summaries

New Discussion
Adam Drew
Adam Drew asked on Sep 19, 2023 7:36 AM

Hi,

I was wondering what would be the best way to hide specific rows on a grid? Surprisingly haven’t come across this even though I thought it would be quite a common problem.

I would be looking to hide a row based on their id or content, whatever is easiest.  The reason for this is I’m using grouping with summaries and if there is only one item in the group, I would like to remove the row while keeping the summary row in place (vice versa would work too but this would look best for our purposes).

Any input would be appreciated!

Adam

Sign In to post a reply

Replies

  • 0
    Monika Kirkova
    Monika Kirkova answered on Sep 15, 2023 10:39 PM

    Hello Adam,

    After an investigation, I have determined that the rows in the igx-grid could be hidden with conditional styling using the rowStyles property. This could be achieved as follows:

    .html:

    <igx-grid  #grid1  [data]="data" [width]="'100%'" [height]="'570px'" (groupingDone)="groupingDone()"  [groupingExpressions]="expr" [rowStyles]="rowStyles">

    .ts

    public rowStyles = {

        display: (row: RowType) =>

          this.oneRecordPerGroupID.includes(row.data.ProductID) ? 'none' : 'flex',

      };

    I have prepared a sample, demonstrating hiding a row if is only one in the group. Please test it on your side and let me know if you need any further information regarding this matter.

    Regards,
    Monika Kirkova,
    Infragistics

    • 0
      Adam Drew
      Adam Drew answered on Sep 18, 2023 8:03 AM

      Perfect!  That works exactly as needed thanks.

      I had something similar but was specific to finding the row's field, but this works better and means I don't have to define the field's string for each check.

      I was mostly checking to see if there was a property I'd missed on row objects to define them as hidden or something.

      Thanks!

      Adam

      • 0
        Monika Kirkova
        Monika Kirkova answered on Sep 19, 2023 7:36 AM

        Hello Adam,

        I am glad my suggestion was helpful and you were able to achieve your requirement.

        Thank you for using Infragistics components.

        Regards,
        Monika Kirkova,
        Infragistics

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Adam Drew
Favorites
0
Replies
3
Created On
Sep 19, 2023
Last Post
2 years, 6 months ago

Suggested Discussions

Created by

Created on

Sep 19, 2023 7:36 AM

Last activity on

Feb 23, 2026 7:48 AM