@@ -1030,7 +1030,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
1030
1030
*/
1031
1031
public getRowByIndex ( index : number ) : RowType {
1032
1032
if ( this . gridAPI . grid . virtualizationState ) {
1033
- return this . createRow ( index ) ;
1033
+ index = index - this . gridAPI . grid . virtualizationState . startIndex ;
1034
1034
}
1035
1035
if ( index < 0 || index >= this . dataView . length ) {
1036
1036
return undefined ;
@@ -1104,6 +1104,9 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
1104
1104
const row = this . getRowByIndex ( rowIndex ) ;
1105
1105
const column = this . columnList . find ( ( col ) => col . field === columnField ) ;
1106
1106
if ( row && row instanceof IgxGridRow && ! row . data ?. detailsData && column ) {
1107
+ if ( this . gridAPI . grid . virtualizationState ) {
1108
+ rowIndex = row . index ;
1109
+ }
1107
1110
return new IgxGridCell ( this , rowIndex , columnField ) ;
1108
1111
}
1109
1112
}
@@ -1143,13 +1146,8 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
1143
1146
*/
1144
1147
public createRow ( index : number , data ?: any ) : RowType {
1145
1148
let row : RowType ;
1146
- let rec : any ;
1147
- if ( this . virtualizationState ) {
1148
- rec = data ?? this . gridAPI . get_row_by_index ( index ) . rowData ;
1149
- } else {
1150
- rec = data ?? this . dataView [ index ] ;
1151
- }
1152
1149
1150
+ const rec : any = data ?? this . dataView [ index ] ;
1153
1151
1154
1152
if ( rec && this . isGroupByRecord ( rec ) ) {
1155
1153
row = new IgxGroupByRow ( this , index , rec ) ;
0 commit comments