why grid datasource are empty when updating record in edit mode

I have an razor page which contain textbox ,combobox and grid control.I have write a below code for adding data from textbox and combobox, the grid datasource are automatically refresh when I add add record from textbox and combobox but when I update datasource in edit mode ,the selected grid record are gets cleared (empty) in datasource.please check the below code and advise why records are gets empty in grid datasource.


Code:-

 public async Task AddRowkeydown(Microsoft.AspNetCore.Components.Web.KeyboardEventArgs args)
    {
        if (args.Key == "Enter")
        {
           
            styleBomLeatherSetup = (StyleBomLeatherSetup)styleBomLeatherDisplaySetup.Clone();


            if (gridmode != CommonClassEnum.FormModes.Edit)
            {
                int maxno = 0;
                if (styleBomLeatherSetups.Count > 0)
                    maxno = styleBomLeatherSetups.Max(t => t.StyleBomLeatherID);
                if (changes.AddedRecords.Count > 0)
                {
                    maxno = changes.AddedRecords.Max(t => t.StyleBomLeatherID);
                }
                styleBomLeatherSetup.TempID = maxno + 1;
                styleBomLeatherSetup.Mode = "N";
                //await gridRef.AddRecordAsync(styleBomLeatherSetup);
                styleBomLeatherSetups.Add(styleBomLeatherSetup);
                gridRef.Refresh();


            }
            else
            {
                gridRef.Refresh();



            }
       
            

            await ClearAll();



        }
    }

   



    public async Task ClearAll()
    {
        EditEnabled = true;
        FixEnabled = true;
        DisableButton = false;
        styleBomLeatherDisplaySetup.PartNoID = null;
        styleBomLeatherDisplaySetup.TypeID = null;
        styleBomLeatherDisplaySetup.LeatherID = null;
        styleBomLeatherDisplaySetup.ColorID = null;
        styleBomLeatherDisplaySetup.Norms = null;
        styleBomLeatherDisplaySetup.Remarks = null;
        styleBomLeatherDisplaySetup.Wastage = null;
        styleBomLeatherDisplaySetup.TotalNorms = null;


        gridmode = CommonClassEnum.FormModes.Add;
        await typeIdRef.FocusAsync();
       
    }


    protected async Task OnEditClicked(StyleBomLeatherSetup args)
    {

        gridmode = CommonClassEnum.FormModes.Edit;
        styleBomLeatherDisplaySetup =  args;
        
        EditEnabled = false;
        await txtnorms.FocusAsync();

    }

1 Reply

RN Rahul Narayanasamy Syncfusion Team December 22, 2021 01:31 PM UTC

Hi KINS, 

Greetings from Syncfusion. 

We have validated your query and the reported problem(The edit form is empty while editing the record) was a known issue at our end. We have already included the fix for the reported problem(Problem with editing when using dialog mode) in 19.3.0.59 version. So could you please upgrade your NuGet version to 19.3.0.59 version or latest version to resolve the problem. 

Could you please upgrade your NuGet version to 19.3.0.59 version or latest version and ensure the reported problem at your end? 

Please let us know if you have any concerns. 

Regards, 
Rahul 


Loader.
Up arrow icon