We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Data not save when grid is in batch mode

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>





2 Replies

NP Naveen Palanivel Syncfusion Team October 6, 2022 10:30 PM

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



NP Naveen Palanivel Syncfusion Team October 10, 2022 10:41 PM

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.

  1. Share more details about your requirement elaborately .
  2. Share video demo of the issue, it’ll be more useful to us to understand your query
  3. Share If possible, reproduce the reported issue in the provided sample or simple issue reproduceable sample


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


Attachment: BlazorApp1010_f0a848d0.zip

Loader.
Live Chat Icon For mobile
Up arrow icon