Hi Greg,
Thanks for using Syncfusion products.
we suggest you to map the child grid using key value with the ColumnName. Then, we suggest you to add the child grid as template with the parent grid. Please refer to the code-snippets below.
[ASPX]
//adding childgrid
Dim gridChildBuilder = Html.Syncfusion().Grid(Of MvcApplication2.Order_Detail)("ChildGridAction_${OrderID}")
'add grid columns using gridChildBuilder
gridChildBuilder.Column(Function(cols) cols.Add(Of Integer)(Function(c As MvcApplication2.Order_Detail) c.ProductID).HeaderText("ProductID"))
gridChildBuilder.Column(Function(cols) cols.Add(Of Integer)(Function(c As MvcApplication2.Order_Detail) c.OrderID).HeaderText("OrderID"))
gridChildBuilder.Column(Function(cols) cols.Add(Of Integer)(Function(c As MvcApplication2.Order_Detail) c.UnitPrice).HeaderText("UnitPrice"))
gridChildBuilder.Column(Function(cols) cols.Add(Of Integer)(Function(c As MvcApplication2.Order_Detail) c.Quantity).HeaderText("Quantity"))
gridChildBuilder.Column(Function(cols) cols.Add(Of Integer)(Function(c As MvcApplication2.Order_Detail) c.Discount).HeaderText("Discount"))
gridChildBuilder.EnablePaging()
gridChildBuilder.EnableGrouping()
gridChildBuilder.EnableSorting()
gridChildBuilder.Mappers(Function(map) _
map.Action("ChildGridAction", New With { _
Key .OrderID = "${OrderID}" _
}))
Dim template = gridChildBuilder.ToChildGridTemplate()
//adding child grid as a template
gridbuilder.ChildGrid(Function(ChildGrid)
ChildGrid.ChildGridTemplate(template)
End Function _
)
[CodeBehind-CS]
_
Function ChildGridAction(ByVal args As PagingParams, ByVal OrderID As Integer) As ActionResult
Dim data As IEnumerable = New NorthwindDataContext().Order_Details.Where(Function(c) c.OrderID = OrderID).ToList()
Dim engine = TryCast(data.GridActions(Of Order_Detail)(), GridHtmlActionResult(Of Order_Detail))
Return engine
End Function
Please refer to the below link to download the modified sample.
Razor sample:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=MvcApplication2-620874601.zipASPX sample:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Grouping-1222922153.zipPlease let me know if you have any queries.
Regards,
Ranjithkumar.