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

Paging KendoUI grid in a Partial view

7 Answers 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kai
Top achievements
Rank 1
Kai asked on 02 Aug 2012, 10:26 PM
I have a  Kendo Grid inside of a partial view, I can get the data that I need to, however when I page through the data it 1) Pages to a new page or 2) nothing shows even though my firebug shows the json that was passed back. Is it possible to page though a grid using a partial view in MVC? if so what do I need to do to make that happen?

7 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 03 Aug 2012, 08:19 AM
Hi Kai,

Unfortunately, it is not clear from the provided information what the cause for the issue might be. Therefore, could you please provide a small sample in which the issue can be observed locally.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kai
Top achievements
Rank 1
answered on 06 Aug 2012, 01:33 PM
I've supplied a sample of what going on. When you page on ajax section it opens the partial view as a new page for whatever reasons. When I tried defining another datasource I kept getting a circular reference error
0
Rosen
Telerik team
answered on 06 Aug 2012, 03:13 PM
Hi Kai,

It seems that you have missed to attached the project.

Greetings,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kai
Top achievements
Rank 1
answered on 06 Aug 2012, 04:28 PM
Ajax Paging Sample

Oops lets try again
0
Rosen
Telerik team
answered on 07 Aug 2012, 06:37 AM
Hi Kai,

I have looked at the project you have provided and found few issues with the way grid is loaded.

- In order to use grid in a partial view loaded through AJAX the grid widget should be also populated through AJAX (either with or without server operations enabled)
- I have noticed that the container in which the partial view is loaded have the same id as the grid widget place within the partial view. This, however,  will produce invalid HTML, and should be avoided. Thus, you will need to change the Name of this Grid instance.

Greetings,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kai
Top achievements
Rank 1
answered on 07 Aug 2012, 01:44 PM
I did notice that but I also noticed if they didn't have the same name it wouldn't page at all, so I was really unsure what to do about it. So you are saying for my datasource should looking something like
.DataSource(ds=>
     ds.Ajax()
     ds.Action(action=action.read("actionname", "controller"));
0
Rosen
Telerik team
answered on 08 Aug 2012, 08:08 AM
Hello Kai,

As I have mentioned in my previous message elements on the page should have different ids. And indeed the DataSource be set to use AJAX binding.

All the best,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Kai
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Kai
Top achievements
Rank 1
Share this question
or