I have several questions in regards to inserting and updating rows. I tried to find easy answers on the docs but it is a little dark, PLEASE follow my questions one by one so you don't get confused, the project files are attached on a zip file. (I REMOVED MY KEY FOR SAFETY, INSTALL YOURS PLEASE)
1) My first question is... how do you customize the ADD button on the top? in the samples the button looks blue, mine looks ugly, please take a look at what I have... I do have a very simple grid that looks like this:
Now that you can see what I have, its a simple list of items, with Id, name (named TextValue), Description, and a boolean named isArchived, that you can see as checkbox. Basically I received this list, and I filter the archived ones so these don't show.
Now, the behavior I want is explained as follow:
When Inserting:
- Create validation rules (which I did and work like a charm!)
- Take and send the item somewhere to be saved...
- if successful then add it to the list, if it fails, then show an error with some description of what happened.
I created a custom Data Adaptor, the problem is that in the examples, it assumes everything goes just fine and the item is just added to the list, which is not a real example... this takes us to my first important question...
2) My second question is: HOW do I notify something went wrong? please take the look at the following example:
If I run this, when adding a new item, it just stays there, doing nothing, no messages, nothing...

In other words, in addition to the validation rules, we must know that something could go bad when sending this data to a remote db or remote API... how can we make this better? how can we let know the user that the information he/she provided was not saved because X did happen?
3) My third question: As you can see, I have a boolean field, called isArchived, I would like that everytime they want to update this field, they should have a confirmation, something like... "are you sure? YES NO"... using the Custom Data Adaptor I noticed that I can't inject IJSRuntime or have any interaction with the blazor component from the Update method, so in my point of view, there's no way I can show a modal or something and wait for the response before proceeding with the update... how do you do such thing?
4) My fourth question: I noticed that I want to abort an insert or update, I just don't do anything and basically, it will not do any changes or inserts, is this the right way to cancel such action? (this is not super-important but would like to know)
5) As I could not create a confirm button from the update method (as explained in my third question), I created a column with a button, that you can see here:
The idea was that if the button was outside of the Custom Data Adaptor, could interact with Blazor, here's how I created the button and the method it calls:
and the method it calls is called Archive as follow:
I created a reference to the grid, as I noticed that the grid was not reflecting the changes I made, according to what I need, if the record isArchived then it should not show, and it works the first time I click the button, the second time, it just makes all my records disappear... no errors, just not there anymore, or at least the may I know why?
Please call me at 832-292-0088 I do have remote access if you need it, so we can play with the sample project if you can't reproduce the problem.
Attachment:
PROJECTTEST_8e3126dc.zip