Grid binding to DataTable with custom popup editor

2 posts, 0 answers
  1. Thomas
    Thomas avatar
    5 posts
    Member since:
    Jun 2011

    Posted 15 Sep 2015 Link to this post

    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

     

  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 16 Sep 2015 Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top