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

Grid binding to DataTable with custom popup editor

1 Answer 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 15 Sep 2015, 06:36 AM

Hi,

we need to bind datatables to a grid. For that we found the following example code:

http://www.telerik.com/support/code-library/binding-to-datatable-0191a594e359

This is working fine with the following exception:

We need a custom popup editor. But this requires a model we do not have because the grid is <dynamic>. What can we do?

 Best regards,

Thomas

 

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 16 Sep 2015, 03:13 PM

Hello Thomas,

Since the Grid is bound to dynamic object a strongly typed object can not be used in the popup editor. A solution would be to define the view helper with the name indicating the property of the model they will be bound to.

Basically the custom editor template will look like :

<h3>Customized Product edit template</h3>
      <br />    
      <div>
          @Html.Editor("ProductName")
      </div>

In this case we assume that the model has a "ProductName" field. 

 

Regards,
Boyan Dimitrov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Thomas
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or