Okay. I cannot figure this out. I have a TreeView bound to a WebHierarchicalDataSource. Everything works as it is supposed to until I put in a where clause in the SQL datasource that "populates" the WHDS.
Anyone have any ideas??
Hello,
This certainly sounds weird. I did try to reproduce the problem, unfortunately to no avail (I am using version 2008.3). Even if I used WHERE clause in my statement, WHDS and UltraWebTree worked fine. I believe the best solution in this case would be to isolate the issue in a small subset of your project and send it directly to our dedicated Developer Support department.
Here is one of the setups I tried:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%@ Register assembly="Infragistics35.WebUI.UltraWebNavigator.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebNavigator" tagprefix="ignav" %><%@ Register assembly="Infragistics35.Web.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI.DataSourceControls" tagprefix="ig" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager> <script type="text/javascript"> </script> <ignav:UltraWebTree ID="UltraWebTree1" runat="server" DataSourceID="WebHierarchicalDataSource1" DefaultImage="" HiliteClass="" HoverClass="" Indentation="20"> <DataBindings> <ignav:NodeBinding DataMember="AccessDataSource1_DefaultView" /> <ignav:NodeBinding DataMember="AccessDataSource1_DefaultView" TextField="LastName" /> <ignav:NodeBinding DataMember="AccessDataSource2_DefaultView" TextField="LastName" /> </DataBindings> </ignav:UltraWebTree> <ig:WebHierarchicalDataSource ID="WebHierarchicalDataSource1" runat="server"> <DataRelations> <ig:DataRelation ChildColumns="ReportsTo" ChildDataViewID="AccessDataSource2_DefaultView" ParentColumns="EmployeeID" ParentDataViewID="AccessDataSource1_DefaultView" /> </DataRelations> <DataViews> <ig:DataView ID="AccessDataSource1_DefaultView" DataMember="DefaultView" DataSourceID="AccessDataSource1" /> <ig:DataView ID="AccessDataSource2_DefaultView" DataMember="DefaultView" DataSourceID="AccessDataSource2" /> </DataViews> </ig:WebHierarchicalDataSource> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb" SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [ReportsTo] FROM [Employees]"> </asp:AccessDataSource> <asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/Nwind.mdb" SelectCommand="SELECT [EmployeeID], [LastName], [ReportsTo] FROM [Employees] WHERE EmployeeID < 50"> </asp:AccessDataSource> </form></body></html>
Your example is a little different than mine, but not much. I notice that you used two access data sources to set up the hierarchy where as I only use one and self refrence. Could that be the problem... ( code below )
<%@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/HCCHMain.master" CodeFile="TreeViewTest.aspx.vb" Inherits="TreeViewTest" %>
<%@ Register Assembly="Infragistics35.WebUI.UltraWebNavigator.v8.3, Version=8.3.20083.2021, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.WebUI.UltraWebNavigator" TagPrefix="ignav" %><%@ Register Assembly="Infragistics35.Web.v8.3, Version=8.3.20083.2021, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.DataSourceControls" TagPrefix="ig" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body><form id="form1" runat="server"> <asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager> <script type="text/javascript"> </script> <ignav:UltraWebTree ID="uwtFormFolders" runat="server" DataSourceID="whdsFolderList" DefaultImage="" HoverClass="" Indentation="20"> <DataBindings> <ignav:NodeBinding DataMember="sdsFolderList_DefaultView" TextField="Name" /> </DataBindings> <ClientSideEvents AfterNodeSelectionChange="uwtFormFolders_AfterNodeSelectionChange" /> </ignav:UltraWebTree> <ig:WebHierarchicalDataSource ID="whdsFolderList" runat="server"> <DataRelations> <ig:DataRelation ChildColumns="ParentID" ChildDataViewID="sdsFolderList_DefaultView" ParentColumns="ItemID" ParentDataViewID="sdsFolderList_DefaultView" /> </DataRelations> <DataViews> <ig:DataView ID="sdsFolderList_DefaultView" DataMember="DefaultView" DataSourceID="sdsFolderList" /> </DataViews></ig:WebHierarchicalDataSource> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb" SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [ReportsTo] FROM [Employees]"> </asp:AccessDataSource> <asp:SqlDataSource ID="sdsFolderList" runat="server" ConnectionString="<%$ ConnectionStrings:csReportingServices %>" SelectCommand="SELECT ItemID, Name, ParentID, Path FROM Catalog WHERE (Type = 1) AND (Hidden = 0) ORDER BY ParentID"> </asp:SqlDataSource> </form></body></html>
Yes, I see, you are using single self-referencing relation. Problem is, I tried this as well (using the Northwind Empoyees ID -> ReportTo fields) and was not able to reproduce that as well.
Maybe something in my environment is different, maybe it is a version thing, or a data thing.. very hard to tell without a reproduction.
Is it possible to create a small subset of your project reproducing the issue and contact our developer support department directly? I believe in this case this is the best way to proceed. Developer Support can be reached via the following link:
http://ko.infragistics.com/Support/#Overview
No problem - and thanks for sharing the solution in public forums - I am sure it will be useful for other developers as well.
Rumen,
Thanks for the help. I figured it out. It turned out to be a data issue. There was a NULL field in the 'Hidden' column which is a bit field. By putting 'Where (Hidden = 0)', the NULL field was causing the problem. I have since changed the where clause to be 'Where Hidden <> 1' and all is working.
I cannot believe it was that simple. It always turns out to be something simple. Lesson learned!
Thanks again and sorry for taking you time.
Doyen