<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Databind Parent Child</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Databind Parent Child]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 14 May 2026 09:27:42 +0000</pubDate>
  <lastBuildDate>Wed, 19 Nov 2014 06:33:15 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=22463</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Databind Parent Child : I am trying to see if I can bind...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22463&amp;PID=72923&amp;title=databind-parent-child#72923</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=8010">Skreen</a><br /><strong>Subject:</strong> 22463<br /><strong>Posted:</strong> 19 November 2014 at 6:33am<br /><br />I am trying to see if I can bind a recordset to the .DataManager of the Report control and specify the parent and child key fields so that the hierarchy is created. Currently I am just binding the recordset and then going through each row and finding the related rows and moving the child rows to the .Childs row of the parent.<div><br></div><div>manual code example</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><div>Set lstResults.DataManager.DataSource = objRecordset</div><div>lstResults.DataManager.DataBind</div></div><div><font color="GREEN"></div><div><span style="line-height: 16.7999992370605px;">' go through each row</span></div><div><span style="line-height: 16.7999992370605px;"></font></span></div><div><div>For Each objReportRow In lstResults.Rows&nbsp;</div><div><span style="line-height: 16.7999992370605px;"><font color="GREEN"></span></div><div><span style="line-height: 16.7999992370605px;">&nbsp; &nbsp; ' check for a child row with a parent Id value</span></div><div><span style="line-height: 16.7999992370605px;"></font></span></div><div>&nbsp; &nbsp; If objReportRow.Record(4).Value &lt;&gt; "0" Then &nbsp;</div><div><span style="line-height: 16.7999992370605px;"><font color="GREEN"></span></div><div><span style="line-height: 16.7999992370605px;">&nbsp; &nbsp; &nbsp; &nbsp; ' find the parent row</span></div><div><span style="line-height: 16.7999992370605px;"></font></span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; Set objReportParentRecord = lstResults.Rows.FindRecordItemByRows(0, lstResults.Records.Count, 0, 3, 0, 0, objReportRow.Record(4).Value, xtpReportTextSearchExactPhrase)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; If Not objReportParentRecord Is Nothing Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Set objParentRecord = objReportParentRecord.Record</div><div><span style="line-height: 16.7999992370605px;"><font color="GREEN"></span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ' move the child row to the Childs collection of the parent</div><div><span style="line-height: 16.7999992370605px;"></font></span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If objParentRecord.Childs.Count = 0 Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Call objParentRecord.Childs.InsertAt(0, objReportRow.Record)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Call objParentRecord.Childs.InsertAt(objParentRecord.Childs.Count, objReportRow.Record)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lstResults.Records.RemoveAt objReportRow.Index</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'objParentRecord.Expanded = True</div><div>&nbsp; &nbsp; &nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; End If</div><div><span style="line-height: 1.4;">Next</span></div><div>&nbsp; &nbsp;&nbsp;</div><div>lstResults.Populate</div></div><div></pre></td></tr></table></div><div><br></div><div>would like to do it something like this:</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><div style="line-height: 16.7999992370605px;">Set lstResults.DataManager.DataSource = objRecordset</div><div style="line-height: 16.7999992370605px;"><span style="line-height: 16.7999992370605px;">lstResults.DataManager.ParentId =&nbsp;</span><span style="line-height: 16.7999992370605px;">objRecordset.Fields("ParentOrderNo")</span></div><div style="line-height: 16.7999992370605px;"><span style="line-height: 16.7999992370605px;">lstResults.DataManager.ChildId =&nbsp;</span><span style="line-height: 16.7999992370605px;">objRecordset.Fields("OrderNo")</span></div><div style="line-height: 16.7999992370605px;">lstResults.DataManager.DataBind</div></div><div style="line-height: 16.7999992370605px;"></pre></td></tr></table></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;">I know this does not exist at the minute, but is there any way to create a hierarchy in the grid when data binding?</div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;">Initial flat grid bound to recordset</div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><img src="uploads/8010/Report_Flat.png" height="323" width="202" border="0" align="left" /><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;"><br></div><div style="line-height: 16.7999992370605px;">Grid after it has been reorganised</div><div style="line-height: 16.7999992370605px;"><img src="uploads/8010/Report_Hierarchy.png" height="343" width="237" border="0" align="left" /><br></div>]]>
   </description>
   <pubDate>Wed, 19 Nov 2014 06:33:15 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22463&amp;PID=72923&amp;title=databind-parent-child#72923</guid>
  </item> 
 </channel>
</rss>