Is there a way to construct a gid like below without any separate Edit/Delete buttons? Like an entry form with 2 way binding.
Attachments column is for selecting a file and we could able to read the file path. Remaining columns can be textBoxes and Datepickers in editable mode, with 2 way binding.
|
<SfGrid @ref="Grid" DataSource="@Orders"
AllowPaging="true" Height="315">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" AllowEditOnDblClick="false"></GridEditSettings>
<GridColumns>
. . .
<GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" ValidationRules="@(new ValidationRules{ Required=true})" Width="120">
<Template>
@{
var con = context as Order;
<div @onclick:stopPropagation="true" @onkeydown:stopPropagation="true">
<SfTextBox @bind-Value="con.CustomerID"></SfTextBox>
</div>
}
</Template>
</GridColumn>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText="Order Date" Format="d" TextAlign="TextAlign.Right" Width="130" Type="ColumnType.Date">
<Template>
@{
var con = context as Order;
<SfDatePicker TValue="DateTime?" @bind-Value="@con.OrderDate" Format="d"></SfDatePicker>
}
</Template>
</GridColumn>
. . .
</GridColumns>
</SfGrid> |
Thanks, this helps.