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.

Replace http://mvc.syncfusion.com/Services/Northwnd.svc/Orders/ From Datasource and use own data source.

Thread ID:

Created:

Updated:

Platform:

Replies:

119350 Jun 9,2015 07:57 AM Jun 10,2015 08:33 AM ASP.NET MVC 1
loading
Tags: Grid
MD. Zahirul Islam
Asked On June 9, 2015 07:57 AM

Hello!

 

I'm new with Syncfusion. I'm trying Syncfusion MVC Control. But I've faced a problem, When working with Hierarchy Grid. I saw you use Northwnd.svc for Child Grid Data Source. But I want to use my own data source. Can you help me?


Thank You


Ajith R [Syncfusion]
Replied On June 10, 2015 08:33 AM

Hi Zahirul,

Thanks for using Syncfusion products.

Query: I want to use my own data source in the child Grid. Can you help me?

We suggest you to use your data source as either OData end point web service link or local data in the child Grid DataSource to perform the Hierarchy functionality in the Grid. Please refer the below code snippet for further details.

Web Service:


@(Html.EJ().Grid<EmployeeView>("HierarchyGrid")

    .Datasource((IEnumerable<object>)ViewBag.datasource)

    --------

    --------

    .ChildGrid(child =>

    {

        // Here you can replace your own web service link

        child.Datasource("http://mvc.syncfusion.com/Services/Northwnd.svc/Orders/")

        ------

        ------

    })


)


Local Data:

public ActionResult GridFeatures()

        {

            //Parent data source

            var DataSource = new NorthwindDataContext().EmployeeViews.ToList();

            ViewBag.datasource = DataSource;


            //Child data source

            var ChildData = new NorthwindDataContext().Orders.ToList();

            ViewBag.childData = ChildData;

            return View();
        }

@(Html.EJ().Grid<EmployeeView>("HierarchyGrid")

    .Datasource((IEnumerable<object>)ViewBag.datasource)

    --------

    --------

    .ChildGrid(child =>

    {

         // Here you can set your own local data

        child.Datasource((IEnumerable<object>)ViewBag.childData)

        ------

        ------

    })


)


Please refer the below link to know about the web service.

https://msdn.microsoft.com/en-us/magazine/dd943053.aspx
https://msdn.microsoft.com/en-us/library/8wbhsy70(v=vs.80).aspx

Please let us know if you have any concerns.

Regards,
Ajith R

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.

;