|
<SfGrid DataSource="@Employees" Height="315">
<GridColumns>
<GridColumn Field=@nameof(EmployeeData.EmployeeID) HeaderText="EmployeeID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field="Name.FirstName" HeaderText="First Name" Width="150"></GridColumn>
<GridColumn Field="Name.LastName" HeaderText="Last Name" Width="130"></GridColumn>
<GridColumn Field="Name.InnerName.FirstName" HeaderText="Last Name" Width="130"></GridColumn>
<GridColumn Field="Name.InnerName.LastName" HeaderText="Last Name" Width="130"></GridColumn>
@*<GridColumn Field="EmployeeData.Name.InnerName.FirstName" HeaderText="Last Name" Width="130"></GridColumn>
<GridColumn Field="EmployeeData.Name.InnerName.LastName" HeaderText="Last Name" Width="130"></GridColumn>*@
<GridColumn Field=@nameof(EmployeeData.Title) HeaderText="Title" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</SfGrid>
Your code
<SfGrid DataSource="@pedidoitems">
<GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Dialog"></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(PedidoItem.Id) HeaderText="Using nameof" Width="3"></GridColumn>
<GridColumn Field=@nameof(PedidoItem.Produto.Nome) HeaderText="Using nameof" Width="3"></GridColumn>
<GridColumn Field="PedidoItem.Id" HeaderText="Not using nameof" Width="3"></GridColumn>
<GridColumn Field="Produto.Nome" HeaderText="Not using nameof" Width="3"></GridColumn>
@*<GridColumn Field="PedidoItem.Produto.Nome" HeaderText="Not using nameof" Width="3"></GridColumn>*@
</GridColumns>
</SfGrid> |
|
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="@EditMode.Dialog">
<Template>
@{
var order = (context as EmployeeData);
}
<div>
<div class="mb-4"><SfNumericTextBox TValue="int?" ID="EmployeeID" Enabled="@((order.EmployeeID == null) ? true : false)" @bind-Value="order.EmployeeID"></SfNumericTextBox></div>
<div class="mb-4"><SfNumericTextBox TValue="int?" ID="Name__ID" @bind-Value="order.Name.ID"></SfNumericTextBox></div>
<div class="mb-4"><SfNumericTextBox TValue="int?" ID="Name__InnerName__ID" @bind-Value="order.Name.InnerName.ID"></SfNumericTextBox></div>
</div>
</Template>
</GridEditSettings> |