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

Define grid in MVC controller

3 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 28 Jun 2015, 03:54 PM

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>

 

 

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 01 Jul 2015, 07:15 AM

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
0
David
Top achievements
Rank 1
answered on 01 Jul 2015, 11:25 AM

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.

0
Kiril Nikolov
Telerik team
answered on 02 Jul 2015, 08:07 AM

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
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
David
Top achievements
Rank 1
Share this question
or