can't get customdataadaptor running

I created a DataForm with a DataGrid (without Adaptor) in it. Everything works fine, but when I tried to Edit and then Update a row in the DataGrid, the program stopped working. I learnt that I should use a custom DataAdaptor for the grid to fully control the Add/Update/Edit/Remove commands, but I cannot get it working. Can you please help me with this?


Attachment: Solution_New_bc4d87e5.zip

1 Reply

SK Sanjay Kumar Suresh Syncfusion Team September 26, 2025 02:00 PM UTC

Hi Hartmut,


Based on your code snippet, it appears that the IsPrimaryKey property is not enabled for any column. Please note that CRUD operations in the Grid rely on a unique primary key column value. Therefore, the IsPrimaryKey property must be enabled for at least one column that contains unique values.Without a primary key, CRUD operations will not function correctly. We recommend enabling the IsPrimaryKey property for a unique column. Additionally, please ensure that AllowEditing and AllowDeleting are enabled in the Grid's EditSettings.Kindly refer to the code snippet below for your reference:


    <SfGrid….

        <GridEditSettings AllowEditing="true" AllowDeleting="true" AllowAdding="true"></GridEditSettings>

     <GridColumns>

   <GridColumn Index="1" Field="Field03" HeaderText="F3"  IsPrimaryKey="true" Width="80">

   </GridColumn>


Additional Reference:

https://blazor.syncfusion.com/documentation/datagrid/in-line-editing

https://blazor.syncfusion.com/documentation/datagrid/connecting-to-adaptors/custom-adaptor#handling-crud-operations


Please get back to us if you have any questions.


Regards,

Sanjay Kumar Suresh


Loader.
Up arrow icon