Hi Sao,
Greetings from Syncfusion support
Query:” To pass the master field ID to the detail form
automatically”
We checked your Query and we prepared sample as per the
requirement To pass the Master Field Id to the detail from when adding new
records. We attached the sample in this ticket. Please refer the attached
sample and snippet code for reference.
Reference: https://blazor.syncfusion.com/documentation/datagrid/editing#default-column-values-on-adding-new-record
|
<SfGrid DataSource="@Employees">
<GridTemplates>
<DetailTemplate>
@{
var employee
= (context as
EmployeeData);
}
<SfGrid DataSource="@Orders" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })" AllowPaging="true" >
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID)
HeaderText="Order ID" IsPrimaryKey="true" DefaultValue="@employee.EmployeeID" TextAlign="TextAlign.Right" Width="110"> </GridColumn>
<GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer ID" Width="110"></GridColumn>
|
Please let us
know if you have any concerns.
Regards,
Naveen Palanivel
Attachment:
MasterGrid_53bc22ed.zip