Hi, I was working through converting a grid to TelerikGrid, referencing this document page:
https://www.telerik.com/blazor-ui/documentation/components/grid/editing/popup
Using GridEditMode.Popup.
Edit and Delete functionality was working.
New record functionality, however, was not. It was triggering the correct dialog editing, but wouldn't trigger a dialog for adding a new record. Instead it would fire my database code to add a record, with null data being passed.
I eventually figured out the example uses the OnCreate event, and I was using the OnAdd event.
This wasn't obvious to me, and there didn't seem to be anything in the documentation indicating you have to use OnCreate for the dialog to appear?
I then found this page which has more details on the events:
https://www.telerik.com/blazor-ui/documentation/components/grid/editing/overview
In the events section of the page, it states:
-
OnAdd
- fires when theAdd
command button for a newly added item is clicked. The event is cancellable.OnCreate
- fires when theSave
command button for a newly added item is clicked. Cancellable (cancelling it keeps the grid in Insert mode).
-
This isn't helpful either, and I'd go so far as to say it's incorrect?
If you have a GridCommandbutton like this:
<GridToolBarTemplate>
<GridCommandButton Command="Add" Icon="@SvgIcon.Plus">Add New</GridCommandButton>
</GridToolBarTemplate>
And you are handling the OnAdd event, the event fires without giving the user a popup, and the data passed in the event is a null item.
If you are handling the OnCreate event, the user gets a popup, however the button to "add" is actually Update:
As you can see, there's neither an Add button to click or a Save button to click.
Perhaps this documentation is correct for other edit modes, but it seems to be misleading or flat out incorrect for Popup mode?
On a side note, the documentation also seems to switch back and forth between saying CUD and CRUD. I can sort of understand why you omit the Read part, but it makes the documentation confusing and I'm not sure you correctly use CUD and CRUD in all the right places. Furthermore, every other database documentation I've seen says CRUD, Read or not!