We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Multiple template in switch case for row template in grid

It is not working.

<ejs-grid #grid [dataSource]='items.dataset' allowFiltering='true' [filterSettings]='filterSettings'>
            <e-columns>
                <ng-container *ngFor="let hitem of items.header">
                    <e-column *ngIf="hitem.Visibility != viewmode"  field='{{hitem.DisplayBinding}}' headerText='{{hitem.HeaderText}}' width='120'></e-column>
                </ng-container>
            </e-columns>
            <ng-container [ngSwitch]="viewmode">
                <ng-template *ngSwitchCase="'widget'" #rowTemplate let-data>
                    <tr>
                        <ng-container *ngTemplateOutlet="gridWidgetItemTemplate; context: {$implicit: data}"></ng-container>
                    </tr>
                </ng-template>
                <ng-template *ngSwitchCase="'all'" #rowTemplate let-data>
                    <tr>
                        <ng-container *ngTemplateOutlet="gridItemTemplate; context: {$implicit: data}"></ng-container>
                    </tr>
                </ng-template>
            </ng-container>
        </ejs-grid>

1 Reply

DR Dhivya Rajendran Syncfusion Team May 17, 2018 12:05 AM

Hi Brijesh, 
Thanks for contacting Syncfusion support. 

We have validated your code example and the reported issue has been reproduced at our end. We confirmed “Row elements are not available while using ngSwitch in row template” as a defect and logged a report for the same. The fix will be available in any of our upcoming release. 
Regards,
R.Dhivya 


Loader.
Live Chat Icon For mobile
Up arrow icon