Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
320
SelfReferenced with 2 datakeys returning empty table
posted

<div>
<ig:WebScriptManager ID="WebScriptManager1" runat="server">
</ig:WebScriptManager>
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" Height="350px"
InitialDataBindDepth="-1" InitialExpandDepth="-1" Width="1000px" AutoGenerateBands="False"
  AutoGenerateColumns="False" DataKeyFields="ProductID, ClassID" DataMember="SqlDataSource1_DefaultView"
DataSourceID="WebHierarchicalDataSource1" IsSelfReference="true" Key="SqlDataSource1_DefaultView">
<Behaviors>
<ig:Paging>
</ig:Paging>
</Behaviors>
<Columns>
  <ig:BoundDataField DataFieldName="ProductID" Key="ProductID">
  <Header Text="ProductID" />
</ig:BoundDataField>
  <ig:BoundDataField DataFieldName="ProductName" Key="ProductName">
<Header Text="ProductName" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="CustomerName" Key="CustomerName">
<Header Text="CustomerName" />
</ig:BoundDataField>
  <ig:BoundDataField DataFieldName="ClassID" Key="ClassID">
<Header Text=" ClassID " />
</ig:BoundDataField>
   <ig:BoundDataField DataFieldName="ParentId" Key="ParentId">
  <Header Text="ParentId" />
</ig:BoundDataField>
</Columns>
</ig:WebHierarchicalDataGrid>
<ig:WebHierarchicalDataSource ID="WebHierarchicalDataSource1" runat="server">
<DataViews>
<ig:DataView ID="SqlDataSource1_DefaultView" DataMember="DefaultView" DataSourceID="SqlDataSource1" />
</DataViews>
<DataRelations>
  <ig:DataRelation ChildColumns="ParentId, ClassID" ChildDataViewID="SqlDataSource1_DefaultView"
ParentColumns="ProductID, ClassID" ParentDataViewID="SqlDataSource1_DefaultView" />
</DataRelations>
</ig:WebHierarchicalDataSource>
  <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyDatabaseConnectionString %>"
  SelectCommand="SELECT [ProductID], [ProductName], [CustomerName], [ClassID], [ParentId] FROM [vwTesting]">
</asp:SqlDataSource>
</div>

 

this scenario was created in designer mode
version 10.2