Kendo grid modal lookup and submit

1 Answer 596 Views
Grid
Andrea
Top achievements
Rank 1
Andrea asked on 11 May 2021, 07:10 PM

Hi,

We need to develop a form for submitting data using kendo grid, in ASP NET CORE 5.0 MVC

basically we need to create an empty grid based on a database table, (this is clear using model binding), the user can click on a button in a toolbar for making a "Lookup" of that database, select one or many row and then, once selected, add them to the previous grid, ready for submit. 

What's the best way to achieve this with telerik controls?

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 14 May 2021, 08:35 AM

Hi Andrea,

In general, the Telerik UI Grid comes with a built-in editing mechanism that could be used for editing. The form submits the values of the input elements, however, the "view" state of the grid has TD elements with values. Hence, the values would not be automatically sent to the server-side. 

As an alternative, you could create ClientTemplates for the cells that would feature the value of the cell and a hidden input. So that when the form is submitted all of the values of the hidden inputs would be sent. Such an example has been shown in the following example:

https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/grid/post-grid-with-form

The example is for ASP.NET MVC, however, the exact same can be applied for the ASP.NET Core framework.

As per setting the data dynamically, you could do so via the data() method and passing the collection of data:

https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/methods/data

I hope you find this helpful.

 

Best regards,
Tsvetomir
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Andrea
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or