@@ -4036,6 +4036,11 @@ export abstract class IgxGridBaseDirective implements GridType,
40364036 }
40374037
40384038 this . setupColumns ( ) ;
4039+ this . columnList . changes
4040+ . pipe ( takeUntil ( this . destroy$ ) )
4041+ . subscribe ( ( change : QueryList < IgxColumnComponent > ) => {
4042+ this . onColumnsChanged ( change ) ;
4043+ } ) ;
40394044 this . toolbar . changes . pipe ( filter ( ( ) => ! this . _init ) , takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => this . notifyChanges ( true ) ) ;
40404045 this . setUpPaginator ( ) ;
40414046 this . paginationComponents . changes . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
@@ -4276,7 +4281,7 @@ export abstract class IgxGridBaseDirective implements GridType,
42764281 * @hidden @internal
42774282 */
42784283 public ngOnChanges ( changes : SimpleChanges ) {
4279- if ( ! changes . autoGenerate ?. firstChange && changes . autoGenerate ?. currentValue && this . data ?. length > 0 && this . columnList ?. length === 0 ) {
4284+ if ( ! changes . autoGenerate ?. firstChange && changes . autoGenerate ?. currentValue && this . data ?. length > 0 && this . columnList ?. length === 0 && this . columns . length === 0 ) {
42804285 // Make sure to setup columns only after the grid is initialized and autoGenerate is changed
42814286 this . setupColumns ( ) ;
42824287 }
@@ -6930,12 +6935,6 @@ export abstract class IgxGridBaseDirective implements GridType,
69306935 this . initColumns ( this . _columns , ( col : IgxColumnComponent ) => this . columnInit . emit ( col ) ) ;
69316936 this . columnListDiffer . diff ( this . columnList ) ;
69326937 this . _calculateRowCount ( ) ;
6933-
6934- this . columnList . changes
6935- . pipe ( takeUntil ( this . destroy$ ) )
6936- . subscribe ( ( change : QueryList < IgxColumnComponent > ) => {
6937- this . onColumnsChanged ( change ) ;
6938- } ) ;
69396938 }
69406939
69416940 protected getColumnList ( ) {
0 commit comments