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

Telerik MVC Grid versus RadGrid

4 Answers 129 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aaron
Top achievements
Rank 1
Aaron asked on 27 Aug 2010, 05:25 PM
I am trying to create a proof of concept to show that MVC is the way to go for our company. One of the biggest stumbling blocks I'm having is replacing the Telerik RadControls specifically the RadGrid because of the way our database is.

Now the RadGrid itself has a wealth of functionality and of course the newer MVC Grid is playing catchup. But there are a few specific scenarios that the MVC Grid needs to support for me to pull this off and I'd like to see what I can do about making this work out.

Databinding to DataTable through Ajax:
 This is kind of a solid requirement. Everyone loves how a grid can ajax the data in without a post, and because my proof of concept is based on performance of MVC versus Webforms I kind of need that to be a functional piece, but because of restrictions on the database and the way it returns variable amounts of columns and large amounts of rows, I need it to be quite dynamic.

 I've read about how the Datatable cannot be used to perform Ajax binding because the JavascriptSerializer doesn't have a clue how to work with a Datatable. As well as you can't return the Datatable as a GridModel because it doesn't inherit from IEnumerable (DataTableReader has an extension method to convert it into an IEnumerable, could we use that?). I would really like to beat this problem, even if I have to create code to serialize it myself and circumvent the JavascriptSerializer. Is there any plans to support this scenario? Or any suggestions on how to approach it?

Drag and Drop:
 One of the things that we use from the RadGrid is the drag and drop for reordering. This seems like just one of those features you have in a grid, and I was wondering if it was on the plan or not and for when.

Column Generation:
 The columns are hidden based on the name, and row buttons are shown based on that columns value. For example the datatable may contain a boolean column for "CanDelete" and based on the name of the row it won't show the column and based on value of that the row it'll decide whether or not to hide/show the row's delete button. Is this something that's possible?

If I can tackle these I'll be well on my way to replacing webforms :D
Thanks in advance for any help.

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 30 Aug 2010, 10:28 AM
Hello Aaron,

Up to your questions

  1. Ajax binding to DataTable
    We are not sure if this is even possible due to the JavaScriptSerializer class. If it is possible to serialize a DataTable by costomizing the JavaScriptSerializer the Grid would bind to the result.
  2. Drag-and-drop for reordering
    Do you mean row or column reordering? Perhaps we will implement column reordering for the next major release.
  3. Hiding the delete button
    This should be possible by hiding the delete button with JavaScript on the client side.

Regards,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Aaron
Top achievements
Rank 1
answered on 30 Aug 2010, 10:19 PM
1. Well, I was thinking of circumventing the javascript serializer in the particular case that it is a datatable. But then my problem becomes the GridModel constructor will only deal with IEnumerable. But I suppose I can do the sorting/filtering myself? Do you think this would work?

2. I mean drag'n drop for row ordering. I haven't seen anything in the docs about this.

3. I like that answer :D

Thanks for the response Atanas.
0
Atanas Korchev
Telerik team
answered on 31 Aug 2010, 07:59 AM
Hi Aaron,

  1. Ajax binding requires the data to be serialized to JSON somehow. Custom binding will not help in this case.
  2. No, currently the grid does not support row reordering by drag and drop and such a feature is not in our TODO list for the next major release.

Regards,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Alex
Top achievements
Rank 1
answered on 12 Apr 2011, 08:26 PM
I did figure out a way to use Ajax Binging with a dynamically generated Datatable. I send the view an empty datatable (to get the columns). Then I convert the datatable so the serializer will accept it, and use the ajax binding to get the data. I have posted a sample application on my blog http://wwwAlexRogan.com

Hope this helps someone else.
Alex
Tags
Grid
Asked by
Aaron
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Aaron
Top achievements
Rank 1
Alex
Top achievements
Rank 1
Share this question
or