This is a migrated thread and some comments may be shown as answers.

Grid binding

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 31 Oct 2018, 06:32 PM

I am using core 2.1. Attempting to use tag-helpers, but documentation is pretty bad. 

We have a grid mostly working for when there is an existing object, but I don't see a way to use the grid for something new.  

For example, if my page is creating a new client, and I'm using the grid for a list of phone numbers, I don't want the grid to go to the server with new entries (create operations), because the client does not exist yet.  

Is there a way to add items to the grid in an offline fashion, then bind the data to the model and post the list back with all the other client information? 

I want one endpoint for a "New Client" operation that can perform all the validation in one sweep, including validating phone numbers.  

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 05 Nov 2018, 10:29 AM
Hello Steve,

You could bind the Grid to a local data array and perform CRUD operations inside it while editing the Grid. This will keep all editing logic on the client. Once you decide to save your new client, the data from the Grid will be available in an array that you can submit with the new entry. 

You can find an example attached to this message that uses the Grid tag helper and edits a local array (that is empty at first) without making any requests to the server.


Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or