BatchEdit and Update

Hi - I have updated to version 18.2.0.47 and are facing a problem with DataGrid BatchSave and AutoComplete in same Column.

 <SfGrid @ref="Grid" DataSource="@OrderData" Toolbar="ToolbaritemsString"
                                        AllowResizing="true" AllowPaging="true" AllowFiltering="true"
                                        EnableAutoFill="true" AllowSelection="true">
                                    <GridSelectionSettings CellSelectionMode="CellSelectionMode.Box" Mode="Syncfusion.Blazor.Grids.SelectionMode.Cell"
                                                           Type="SelectionType.Multiple"></GridSelectionSettings>
                                    <GridEditSettings AllowEditing="true" Mode="EditMode.Batch" ShowConfirmDialog="true"></GridEditSettings>
                                    <GridEvents OnToolbarClick="ToolbarClickHandler" OnBatchSave="@((args)=>BatchSaveHandler(args,"Grid"))"
                                                CellSelected="@((args)=>CellSelectHandler(args,"Grid"))" TValue="OrderData"></GridEvents>
                                    <GridPageSettings PageCount="@pageCount" PageSize="@pageSize" CurrentPage="@currentPage" PageSizes="@pageSizes" />

                                    <GridColumns>
 <GridColumn Field=@nameof(OrderData.Order) HeaderText="Order" AllowEditing="true" ValidationRules="@(new ValidationRules{ Required=true})">
                                                </GridColumn>

This column can be edited and trick the grid to reconize the change, 


but if I use a EditTemplate to Autocomplete

                                        <GridColumn Field=@nameof(OrderData.Order) HeaderText="Order" AllowEditing="true" ValidationRules="@(new ValidationRules{                                                                            Required=true})">
                                                                                               <EditTemplate>
                                                <SfAutoComplete @ref="ACOrder" ID="Order" Value="@((context as OrderData).Order)"
                                                                DataSource="@OrderData.GroupBy(o => new { o.Order }).Select(o => o.FirstOrDefault()).ToList()">
                                                    <AutoCompleteFieldSettings Value="Order"></AutoCompleteFieldSettings>
                                                    <AutoCompleteEvents Created="@(() => OnCreate("Order"))" TValue="string"></AutoCompleteEvents>
                                                </SfAutoComplete>
                                            </EditTemplate>
                                        </GridColumn>
the grid does not reconize the change. 

This must be a bug in the new version, but is there a property in the grid where I can set the status to "Update-able" ? and manually trick this state? 



3 Replies 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team July 31, 2020 09:42 AM UTC

Hi Soren, 

Greetings from Syncfusion support. 

We suggest you to ensure to set @bind-Value property for the SfAutoComplete instead of Value property to overcome the problem you are facing. Please use as like the code below, 

 
<EditTemplate> 
    <SfAutoComplete ID="CustomerID" TItem="Order" TValue="string" @bind-Value="@((context as Order).CustomerID)" DataSource="@Orders"> 
        <AutoCompleteFieldSettings Value="CustomerID"></AutoCompleteFieldSettings> 
    </SfAutoComplete> 
</EditTemplate> 



Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 


Marked as answer

SM Soren M August 1, 2020 10:40 AM UTC

Yes - this is exatly what I wanted. 

Thanks 


RS Renjith Singh Rajendran Syncfusion Team August 3, 2020 12:59 PM UTC

Hi Soren, 

We are glad to hear that the provided suggestion helped you in achieving the requirement. 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 


Loader.
Up arrow icon