WebDataTree with enabled load-on-demand does not work with WebhierarchyDataSource with Self-Related Data Relation.
Is it bug or feature?
Vladimir
Vladimir,
I am assuming you are talking about the Infragistics WebHierarchicalDataSource.
This feature should work fine. Did you set up a DataBinding on the tree for the datasource. The following code for me brings the first level in initially and fetches subsequent ones. What exactly was the problem you experienced? No data? All data at the start?
<ig:WebDataTree ID="WebDataTree1" runat="server" Height="300px" Width="200px" DataSourceID="WebHierarchicalDataSource1" InitialDataBindDepth="0"> <DataBindings> <ig:DataTreeNodeBinding DataMember="AccessDataSource1_DefaultView" TextField="TextValue" ValueField="Code" /> </DataBindings> </ig:WebDataTree> <ig:WebHierarchicalDataSource ID="WebHierarchicalDataSource1" runat="server"> <DataRelations> <ig:DataRelation ChildColumns="ParentCode" ChildDataViewID="AccessDataSource1_DefaultView" ParentColumns="Code" ParentDataViewID="AccessDataSource1_DefaultView" /> </DataRelations> <DataViews> <ig:Dataview id="AccessDataSource1_DefaultView" datamember="DefaultView" datasourceid="AccessDataSource1"> </ig:Dataview> </DataViews> </ig:WebHierarchicalDataSource> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/TreeData.mdb" SelectCommand="SELECT [Code], [TextValue], [ParentCode] FROM [Data]"> </asp:AccessDataSource>
regards,
David Young
Yes
That example is working.
I was trying to use codebehand and it does not work
Here is my aspx
-----START ASPX -------
>
----- END ASPX -----------
Then
view =
New DataView
view.ID =
"DefailtView"
view.DataSourceID =
Me.AccessDataSource1.ID
view.DataMember =
relation =
New DataRelation
relation.ChildColumns =
New String() {"ParentCode"}
relation.ChildDataViewID = view.ID
relation.ParentColumns =
New String() {"Code"}
relation.ParentDataViewID = view.ID
binding =
New DataTreeNodeBinding
binding.DataMember = view.ID
binding.TextField =
"TextValue"
binding.ValueField =
"Code"
--- START CODE BEHIND ---
--- END CODE BEHIND --