We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

MVC 3 - Razor - GridView Control - Grouping

I have implemented GridView using Syncfusion MVC 3 Razor controls. I have to implement the Grouping functionality in it. When I open the page first time than it's working fine. But when I am trying to do any operation after that (operations like Add/Remove Group column) at that time it's giving me below error.

"Microsoft JScript runtime error: Object doesn't support property or method 'draggable'"

Please help me out.

There is also some problem with JSON. It's showing no or records and also Page numbers based on page size but I am not able to see any data in the gridcview. It's giving message like "Bi record found"

Please help me out.

ThankS
Alok Shah


8 Replies

AD Administrator Syncfusion Team July 26, 2011 09:39 AM UTC

I am using trial version of Syncfusion 9.2.0.137



AD Administrator Syncfusion Team July 26, 2011 11:17 AM UTC

Hello,

Please find my code as an attachment for your reference.

Please run below links for error


http://localhost:50476/Home/JsonPagingGrid
When you will run above link it will show the number of records and number pages based on that number of records but wont show any data in Grid. Can somepbody please tell me what's wrong with my code?


http://localhost:50476/Home/GroupGrid
When you will run above link it will come up with data. Try to drag a column for the grouping but it's not working. It's giving me some error.Can somebody tell me what's wrong with my code?

Thanks
Alok Shah



SyncfusionMvcApplication1_20d12560.rar


AD Administrator Syncfusion Team July 26, 2011 11:39 AM UTC

Hello,


I have resolved the grouping issue but still JSON issue is there. Please help me out.

Thanks
Alok Shah



ES Eswari S Syncfusion Team July 28, 2011 05:03 AM UTC


Hi Alok,

Thank you for your interest in Syncfusion products.

Json Mode :

This issue has been caused as you have used the Orders table. We cannot use Orders table in Json mode. Since entities that have relationships (i.e. Circular reference) with other Entity types cannot be serialised through Json. For example,a Customer table connected to an Orders table will not translate well into Json serializing because a Customer may have many orders and again an Order is associated with a Customer.

We have modified your code with OrderViews table. The OrderViews table is available in Northwind\Views tables without any circular references and hence it works with Json. Please refer to the following code snippets:

[APSX]

@{ Html.Grid("Grid1")
.ActionMode(ActionMode.JSON)

.Datasource((IEnumerable)ViewData["GridModel"])


.Render();
}

[Controller]

public ActionResult JsonPagingGrid(Skins? skins)
{
ViewData["DefaultSkin"] = skins == null ? Syncfusion.Mvc.Shared.Skins.Sandune : (Skins)skins;
return View();
}

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult JsonPagingGrid(PagingParams pagingParams)
{
IEnumerable data = new NorthWndDataContext().OrdersViews.Take(100).ToList();
ViewData["GridModel"] = data;
ActionResult result = data.GridJSONActions();
return result;
}

Please try this and let us know if you would require any further assistance.

Regards,
Eswari.S





AD Administrator Syncfusion Team July 28, 2011 09:25 AM UTC

Hi Eswari

Thanks for the support. You are right. I have resolved this issue yesterday only. This means we have to create view for product, order, orderdetail and list is go on.

For this I have created a custom classes which is same scenario you mentioned. In my application I have created class Student and Branch. Now Student is referencing branch with branch id and It's working fine. Please find this application as an attachment and run below link.
http://localhost:50476/Home/JsonGroupGrid
You can see that it's working fine.

That means this grid does not compatible with the Entity framework in case of JSON?



SyncfusionMvcApplication1_e1378803.rar


SN Sridhar N Syncfusion Team July 29, 2011 09:32 AM UTC

Hi Alok,

Thanks for your update.

As we said earlier in general JSON mode, we can't use the entity having relationship between another entity (i.e Circular reference). This is not the issue with our grid generally JSON mode don't support circular referenced data. We have modified your sample to reproduce the issue of circular reference and the same can be downloaded from the following link.

SyncfusionMvcApplication11761143727.zip

Could you please check the above sample and let us know your concerns.

Regards,
Sridhar N



AD Administrator Syncfusion Team August 1, 2011 05:27 AM UTC

Thanks Sridhar. It's now clear to me.



ES Eswari S Syncfusion Team August 3, 2011 04:09 AM UTC

Hi Alok,

Thanks for the update.

Happy to hear that you have everything working . Do not hesitate to update if you have any questions.

Regards,
Eswari.S


Loader.
Live Chat Icon For mobile
Up arrow icon