Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / get the row data and cell Data in igx-grid

get the row data and cell Data in igx-grid

New Discussion
Shobhana Suara
Shobhana Suara asked on May 19, 2023 7:13 AM

Hi team,

Uisng Igx data grid, i want to get the row data when i click button in another grid. Here id is a primary key. i have already mentioned. Also how can i get Column data?

i am not able to access the grid data by using

TS:

 @ViewChild(‘grid1’, { read: IgxGridComponent, static: false }) public grid1: IgxGridComponent;
onBtnClick() {

this.grid1.getRowByIndex(this.id).rowData.

}

Button is outside of grid and i want to access the row data.

Sign In to post a reply

Replies

  • 0
    Shobhana Suara
    Shobhana Suara answered on May 18, 2023 10:15 AM

    Using 9.1.28 version of Infragistics

    • 0
      Teodosia Hristodorova
      Teodosia Hristodorova answered on May 19, 2023 7:13 AM

      Hello,

      I have been looking into your question and prepared a small sample in order to test the described behavior.

      However, since version 9 is considered retired and no longer eligible for Developer Support Services, the provided sample is using the latest version i.e. 16.0.0 and there could be differences in the properties and methods between these versions. Having this in mind, my suggestion is to update to the latest version.

      Anyways, what I could say is that on my side everything works as expected and I'm able to get the row data, however, please note that getRowByIndex() accepts as parameter row index i.e. value between 0 and (data.length – 1). If your requirement is to get a specific row by primary key what I could suggest is using the getRowByKey() method.

      Regarding your second question about getting the column data, an approach I could suggest is to get the required column via getColumnByVisibleIndex(index: number) or getColumnByName(field: string) and loop through its cells collection in order to get each cell value:

          //Get column via getColumnByVisibleIndex() or getColumnByName()
          this.grid1.getColumnByVisibleIndex(0).cells.forEach((cell) => {
            console.log(cell.value);
          });

      A small sample could be found here.

      Also, a list of all igx-grid properties and methods in version 16 could be found here and for version 9.1.28 here.

      Let me know if I may be of any further assistance.

      Sincerely,
      Teodosia Hristodorova
      Software Developer

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Shobhana Suara
Favorites
0
Replies
2
Created On
May 19, 2023
Last Post
2 years, 9 months ago

Suggested Discussions

Created by

Created on

May 19, 2023 7:13 AM

Last activity on

Feb 20, 2026 11:13 AM