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.
Unfortunately, activation email could not send to your email. Please try again.

MVC 3 - Razor - GridView Control - Grouping

Thread ID:

Created:

Updated:

Platform:

Replies:

100315 Jul 26,2011 05:38 AM Aug 3,2011 12:09 AM ASP.NET MVC (Classic) 8
loading
Tags: Grid
Administrator [Syncfusion]
Asked On July 26, 2011 05:38 AM

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


Administrator [Syncfusion]
Replied On July 26, 2011 05:39 AM

I am using trial version of Syncfusion 9.2.0.137


Administrator [Syncfusion]
Replied On July 26, 2011 07:17 AM

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

Administrator [Syncfusion]
Replied On July 26, 2011 07:39 AM

Hello,


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

Thanks
Alok Shah


Eswari S [Syncfusion]
Replied On July 28, 2011 01:03 AM


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




Administrator [Syncfusion]
Replied On July 28, 2011 05:25 AM

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

Sridhar N [Syncfusion]
Replied On July 29, 2011 05:32 AM

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


Administrator [Syncfusion]
Replied On August 1, 2011 01:27 AM

Thanks Sridhar. It's now clear to me.


Eswari S [Syncfusion]
Replied On August 3, 2011 12:09 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;