Define grid in MVC controller

4 posts, 0 answers
  1. David
    David avatar
    22 posts
    Member since:
    Jun 2015

    Posted 28 Jun 2015 Link to this post

    Is it possible to define the grid attributes/properties in the MVC controller rather than the view to simplify the view at all?  I am currently evaluating Kendo before deciding whether or not to migrate from Infragistics IgniteUI.  

    Infragistics IgniteUI igGrid allows you to define a GridModel (their object type) instance in your controller and pass it to the View which allows a much simpler bit of syntax in the view similar to:

    Controller code:

        Public Function IGGridModel() As Infragistics.Web.Mvc.GridModel

            Dim grdModel As GridModel = New Infragistics.Web.Mvc.GridModel.GridModel()

            With grdModel
                 . ID = ....

                .columns ....

                 etc, etc

             End With

             Return grdModel

        End Function

     

    View Code:

       <div ....  whatever>

            @Html.Infragistics().Grid(Model.IGGridModel)
      </div>

     

     

  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 01 Jul 2015 Link to this post

    Hello David,

    The Kendo UI framework has the similar approach. It is described here:

    http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/overview

    Regards,
    Kiril Nikolov
    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. David
    David avatar
    22 posts
    Member since:
    Jun 2015

    Posted 01 Jul 2015 in reply to Kiril Nikolov Link to this post

    Thanks for taking the time to reply Kiril, but your link does not address my question.  It merely differentiates between kendo controls being data bound on the server vs being data-bound on the client (via ajax).  I was more interested in having a wrapper class for a kendo control which could be instantiated in the controller or model and just passed to the razor engine with one line.

    Not a major issue, just nice to have.

  4. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 02 Jul 2015 Link to this post

    Hello David,

    You can submit this as a feature request on UserVoice, so that it is considered for implementation in a future release.

    Regards,
    Kiril Nikolov
    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
Back to Top