Hello,
Grid not assigned ID of the identity ( and also a primary) field when in batch mode, therefore data is not saved to database. Data is saved when grid is in Dialog mode.
<DetailTemplate Context="HCContext">
<SfTab>
<TabItems>
<TabItem>
<ChildContent>
<TabHeader Text="HC Report"></TabHeader>
</ChildContent>
<ContentTemplate>
@{
var ODRecord = (HCContext as HC);
<SfGrid DataSource="@ListHCReport" Query="@(new Query().Where("HFCODE", "equal", ODRecord.HFCODE))"
AllowFiltering="true" AllowPaging="true" AllowSorting=true AllowTextWrap=true AllowExcelExport=true
Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update", "ExcelExport", "Search", "Print" })">
<GridPageSettings PageSize="10"></GridPageSettings>
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Excel"></GridFilterSettings>
<GridEvents OnActionBegin="ActionBeginHandlerHCReport" TValue="HCReporting">
</GridEvents>
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="Syncfusion.Blazor.Grids.EditMode.Batch"></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(HCReporting.ID) HeaderText="ID" IsIdentity=true IsPrimaryKey=true Width="20" Visible=true></GridColumn>
<GridColumn Field=@nameof(HCReporting.HFCODE) HeaderText="HC Code" Width="30" DefaultValue="@ODRecord.HFCODE" Visible=false></GridColumn>
<GridColumn Field=@nameof(HCReporting.HF) HeaderText="HC" Width="20" Visible=false></GridColumn>
<GridColumn Field=@nameof(HCReporting.Dt) HeaderText="Date" Format="dd-MMM-yy" Type="ColumnType.Date" Width="25" Visible=true></GridColumn>
<GridColumn Field=@nameof(HCReporting.Val) HeaderText="Val" Width="25" Visible=true EditType="EditType.BooleanEdit" DisplayAsCheckBox=true TextAlign="TextAlign.Right"></GridColumn>
</GridColumns>
<GridSortSettings>
<GridSortColumns>
<GridSortColumn Field="Dt" Direction="SortDirection.Descending"></GridSortColumn>
</GridSortColumns>
</GridSortSettings>
<GridAggregates>
<GridAggregate>
<GridAggregateColumns>
<GridAggregateColumn Field=@nameof(HCReporting.ID) Type="AggregateType.Count" Format="N0">
<FooterTemplate>
@{
var aggregate = (context as AggregateTemplateContext);
<div>
<p>Number of entries: @aggregate.Count</p>
</div>
}
</FooterTemplate>
</GridAggregateColumn>
</GridAggregateColumns>
</GridAggregate>
</GridAggregates>
</SfGrid>
}
</ContentTemplate>
</TabItem>
</TabItems>
</SfTab>
</DetailTemplate>
Hi Sao,
Sorry for the inconvenience.
We are currently Validating the reported query with at our end and we will update the further details within two days(Oct 10, 2022). Until then we appreciate your patience.
Regards,
Naveen Palanivel
Hi Sao,
We checked your query with given code we prepared simple sample as Grid inside the SfTab in Batch mode and we attached in this ticket. But we are quite unclear about your exact requirement. So kindly share the following details to validate the reported query further at our end.
Above requested details will be helpful for us to validate the reported query at our end and provide solution as early as possible.
Regards,
Naveen Palanivel