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.

Hierarchichal Use

Thread ID:

Created:

Updated:

Platform:

Replies:

129630 Feb 25,2017 08:58 AM Mar 27,2017 11:07 AM ASP.NET Core 3
loading
Tags: Grid
Ardani
Asked On February 25, 2017 08:58 AM

Hi,

I have question regarding TreeGrid for ASP.NET Core.

My aim is to use the TreeGrid for the admin page of my site.

The admin page requires editing of data in 3 tables.
Departments->Categories->Products

When i was looking at the documentation, I could not locate example on how to
add columns for detail tables, the example only shows columns for the main/root table.

Could please provide an example of how to insert, update, list and delete data in suggested hierarchy?

Many Thanks,

Amir



Manikandan Manikam [Syncfusion]
Replied On February 28, 2017 12:42 AM

Hi Amir,  
Currently TreeGrid only supports data collection from same table with parent-child relationship, we can’t create hierarchical structure with multiple table’s data collection. 
Grid control supports relational binding support with multiple tables, please find the demo link below. 
Can you please check this sample and let us know whether this meets your requirement? 
Thanks, 
Manikandan M. 


Ardani
Replied On March 25, 2017 05:15 AM

Hi Manikandan,

Yes, I think your suggestion will cover my requirements. 

Many Thanks,

Ardani

Jayaprakash Kamaraj [Syncfusion]
Replied On March 27, 2017 11:07 AM

Hi Amir, 
  
Based on your request we have created  a Grid sample with Hierarchy in ASP.NET core that can be downloaded from the following link. 
  
  
  
<ej-grid id="Grid" datasource=ViewBag.parent allow-paging="true"  
    child-grid="@(new GridProperties() { 
    QueryString = "EmployeeID", 
    EditSettings = new EditSettings() { 
        AllowEditing =true, AllowAdding=true, AllowDeleting=true 
    }, 
    ToolbarSettings = new ToolbarSettings() { 
        ShowToolbar = true, 
        ToolbarItems = new List<string>() { 
            "add", "edit", "delete", "update", "cancel" 
        } }, 
    DataSource = new DataSource() { 
        Json = ViewBag.child1, 
        InsertURL = "/Home/CellEditInsert", 
        UpdateURL = "/Home/CellEditUpdate", 
        RemoveURL = "/Home/CellEditDelete", 
        Adaptor = "remoteSaveAdaptor" 
    }, 
    Columns = { new Column() { Field = "ID", IsPrimaryKey=true, HeaderText = "OrderID" }, 
                new Column() { Field = "EmployeeID", AllowEditing=false, HeaderText = "OrderID" }, 
                new Column() { Field = "CustomerID", HeaderText = "CustomerID" }, 
                new Column() { Field = "Freight", HeaderText = "Freight" }, 
                new Column() { Field = "ShipCity", HeaderText = "ShipCity" } 
    }, 
    ChildGrid = new GridProperties() 
    { 
        QueryString = "CustomerID", 
        DataSource = new DataSource() { 
            Json = ViewBag.child2, 
            UpdateURL = "/Home/CellEditUpdate1", 
            RemoveURL = "/Home/CellEditDelete1", 
            Adaptor = "remoteSaveAdaptor" 
        }, 
        EditSettings = new EditSettings() { 
            AllowEditing = true, AllowAdding = true, AllowDeleting = true 
        }, 
        ToolbarSettings = new ToolbarSettings() { 
            ShowToolbar = true, 
            ToolbarItems = new List<string>() { "add", "edit", "delete", "update", "cancel" } 
        }, 
        Columns = { 
            new Column() { Field = "CustomerID", IsPrimaryKey=true, AllowEditing=false, HeaderText = "CustomerID" }, 
            new Column() { Field = "CompanyName", HeaderText = "CompanyName" } 
        } 
    } 
  
  
Regards, 
  
Jayaprakash K.  


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.

;