```C#
<SfGrid @ref="GridObj" DataSource="@Characters"> <GridTemplates> <RowTemplate> @{ var emp = (context as Character); <td> @emp?.CharacterId </td> <td> @emp?.Name </td> <td> @emp?.Appearances </td> } </RowTemplate>
<DetailTemplate> @{ var empo = (context as Character);
<div>@empo?.Appearances</div> } </DetailTemplate>
</GridTemplates>```|
<SfGrid @ref="Grid" DataSource="@Employees" Width="400" Height="335">
<GridTemplates>
<RowTemplate Context="emp">
@{
var employee = (emp as EmployeeData);
<RowComponent employee="employee"></RowComponent>
}
</RowTemplate>
<DetailTemplate>
@{
var employee = (context as EmployeeData);
. . . . . . .
}
</DetailTemplate>
</GridTemplates>
<GridColumns>
<GridColumn HeaderText="Employee Image" Width="250" TextAlign="TextAlign.Center"> </GridColumn>
<GridColumn HeaderText="Employee Details" Width="300" TextAlign="TextAlign.Left"></GridColumn>
</GridColumns>
</SfGrid> |
Hi Team ,
I want to use same Rowtemplate & Child template at same time like Hierarchical binding but i want to make some custom but not able to achive the same using angular .
Below is my code. any suggestion please let me know.
<ejs-grid
#grid
[childGrid]='childGrid'
[dataSource]="data"
id="dataview"
[editSettings]="editSettings"
[toolbar]="toolbar"
[allowSorting]="enableSorting"
[pageSettings]="initialPage"
allowResizing="true"
(toolbarClick)="toolbarClick($event)"
(rowSelected)="rowIsSelected($event)"
(actionComplete)="actionEndHandler($event)"
[allowPdfExport]="showPdfExport"
[showColumnChooser]="showColumnChooser"
(dataStateChange)="onDataStateChanged($event)"
>
<e-columns>
<e-column *ngFor="let column of columnsList"
[field]="column.key"
[headerText]="column.header"
[width]="column.width"
[textAlign]="column.textAlign"
[headerTextAlign]="column.hederAlign"
[visible]="column.visible"
[type]="column.type"
[format]="column.format">
</e-column>
<ng-container
*ngIf="UseFundConsoleTemple===true">
<ng-template
#rowTemplate let-data
>
<tr
class="static-row"
*ngIf="data.index == 0" >
<td class="centre" >Group One </td>
<td
colspan="7"> </td>
</tr>
<tr
class="e-altrow"
>
<td
class="centre"
>{{data.fund}} </td>
<td
class="centre">{{data.fundType}} </td>
<td
class="centre">
<div
class="float-container">
<div
class="float-childtext">
<div
class="centre"> {{data.typeOfInvestment}}</div>
</div>
<ng-container
*ngIf="data.investmentCount > 0">
<div
class="float-child">
<div
class="numberCircle">{{data.investmentCount}}</div>
</div>
</ng-container>
</div>
</td>
<td
class="centre">{{(data.fundAdministrator)}}</td>
<td
class="centre">
<div
class="float-container">
<div
class="float-childtext">
<div
class="centre"
> {{(data.brokerCustodian)}}</div>
</div>
<ng-container
*ngIf="data.brokerCount > 0">
<div
class="float-child">
<div
class="numberCircle">{{data.brokerCount}}</div>
</div>
</ng-container>
</div>
</td>
<td
class="centre">{{(data.reportingCurrency)}}</td>
<td
class="centre">{{(data.periodBeginDate)}}</td>
<td
class="centre">{{(data.periodBeginDate)}}</td>
</tr>
</ng-template>
<ng-template
#childtemplate
let-childData>
<!-- <div class="">
<span style="font-weight: 500;">First Name: </span> {{childData.OrderID}}
</div> -->
</ng-template>
</ng-container>
<!-- <e-column headerText="Actions"
width="30"
[commands]="commands"
*ngIf="commands.length > 0"
textAlign="center">
</e-column> -->
</e-columns>
</ejs-grid>