var COIncidenRelationQuery = (from CostOfIncidentBinding coiparent in ilParentChild where coiparent.ParentIncidentID == 0 select new { coiparent.IncidentID, coiparent.SiteSafeID, coiparent.IncidentStartDate, coiparent.IncidentEndDate, coiparent.ParentIncidentID, coiparent.CostOfIncidentGUID, coiparent.IsOnGoing, coiparent.ReportingQuarter, coiparent.EnteredBy, coiparent.AreaName, coiparent.BlockName, coiparent.PlatformName, coiparent.IncidentStatusName, coiparent.CreatedBy, CostOfIncidentBinding1 = (from CostOfIncidentBinding coichild1 in ilParentChild where coichild1.ParentIncidentID == coiparent.IncidentID && coiparent.IncidentID != 0 select new { coichild1.IncidentID, coichild1.SiteSafeID, coichild1.IncidentStartDate, coichild1.IncidentEndDate, coichild1.ParentIncidentID, coichild1.CostOfIncidentGUID, coichild1.IsOnGoing, coichild1.ReportingQuarter, coichild1.EnteredBy, coichild1.AreaName, coichild1.BlockName, coichild1.PlatformName, coichild1.IncidentStatusName, coichild1.CreatedBy, CostOfIncidentBinding2 = (from CostOfIncidentBinding coichild2 in ilParentChild where coichild2.ParentIncidentID == coichild1.IncidentID && coichild1.IncidentID != 0 select new { coichild2.IncidentID, coichild2.SiteSafeID, coichild2.IncidentStartDate, coichild2.IncidentEndDate, coichild2.ParentIncidentID, coichild2.CostOfIncidentGUID, coichild2.IsOnGoing, coichild2.ReportingQuarter, coichild2.EnteredBy, coichild2.AreaName, coichild2.BlockName, coichild2.PlatformName, coichild2.IncidentStatusName, coichild2.CreatedBy, CostOfIncidentBinding3 = (from CostOfIncidentBinding coichild3 in ilParentChild where coichild3.ParentIncidentID == coichild2.IncidentID && coichild2.IncidentID != 0 select new { coichild3.IncidentID, coichild3.SiteSafeID, coichild3.IncidentStartDate, coichild3.IncidentEndDate, coichild3.ParentIncidentID, coichild3.CostOfIncidentGUID, coichild3.IsOnGoing, coichild3.ReportingQuarter, coichild3.EnteredBy, coichild3.AreaName, coichild3.BlockName, coichild3.PlatformName, coichild3.IncidentStatusName, coichild3.CreatedBy } ).ToList() }).ToList() }).ToList() }).ToArray(); grid.DisplayLayout.MaxBandDepth = 6; grid.DataSource = COIncidenRelationQuery; grid.Rows.ExpandAll(true);