Grid Checkbox Save change

Hi,

I have a grid with task. I would like to click the checkbox in the grid and save the value.
Is this possible?

I think it would be the best to use the change event of the check box? I used invoke method, but there is no submit form method to chose?
image

Thanks.

You need to handle the Change event of the Checkbox from the template editor. It's value will be available as the ${event} argument and the current data item is available as ${data}.

Not sure what this means. Please elaborate.

I tried this to save the changed value back to the database:

ChecklistePositionen pos = (ChecklistePositionen)data;
            pos.Erledigt = args;
            var autohausWolfDataUpdateChecklistePositionenResult = await AutohausWolfData.UpdateChecklistePositionen(id: pos.Id, checklistePositionen: pos);
            if (autohausWolfDataUpdateChecklistePositionenResult.StatusCode != System.Net.HttpStatusCode.PreconditionFailed)
            {
                DialogService.Close(pos);
            };

But it is not working.
I am not able to change the boolean with args.
Thanks.

What is not working? What does "I am not able to change the boolean with args" mean? What happens when you debug this method in Visual Studio?

I used the debuger in visual studio and fiddler.

the update method makes a patch operation and the statuscode is ok in fiddler and in visual studio.
I changed the value to true -> update ok -> reload -> the value is false.

So I am not able to save the entry correct to the dabase? But I do not know why?
Thanks.

Can you confirm that the updated value is actually true? You can inspect it with the debugger or check it in fiddler.

You can also attach the debugger in the controller which performs the update to see what the argument is.

Now I found the missing thing.

I forgot to set the data value in the template editing.

Now it is working. Thanks.