SyncFusion Grid #3217
Replies: 4 comments 2 replies
-
Hopefully the grid raises an event when a new item is added/created? If so, you can probably use that event to get access to the newly created instance, use the ... After I typed that, it occurs to me that the grid probably creates the instance, then adds it to the business collection. The business collection does have a method you can override when a new item is added, and you could set |
Beta Was this translation helpful? Give feedback.
-
The grid is instantiating the class calling the parameter less constructor. When it does this, the ID of the object is null and that throws an error. I've been trying to intercept the invocation and generation. Your suggestion caught me off guard as I thought the application context was for principles, auth and authenticated. I am reading chapter 5 again to see how this would work :-). |
Beta Was this translation helpful? Give feedback.
-
I think the Id issue is a red herring. It's the private unique field of the instance from the db. Here is what my class looks like:
(I append my business classes with Info if read only. I append InfoPersist when it's editable. The base class ChartOfAccount, tells me it's the class from the database using EF Core. When I'm looking through the system I can instantly tell where in the architecture the class is located). These types of objects are contained in lists--such things as code lists, chart of accounts, and typically two or three attributes for the class I use in lists for ease of editing and viewing. That's how they are edited so they have the MarkAsChild() in the constructor. Moreover, because I'm using Automapper and use graphs a lot, I needed to include MarkAsChild() in the default constructor. If I remove it, I have no idea how to have Automapper map a graph structure. If you think this is a bad idea, let me know. It works well with WPF under the older .Net framework, but these are new times. I just started adding the IUseApplicationContext interface based on your suggestion. Do I need to do anything else with the class so that it is initialized? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is anyone else using the Syncfusion Blazor grid? I'm having a devil of a time getting the edit and add new to work correctly. I hope this isn't too vague, but I'm looking to see if anyone else has overcome the automatic instantiation of a business object.
Beta Was this translation helpful? Give feedback.
All reactions