Hi,
I'm trying to setup a datarelation and am getting the following error:
Literal content ('<igds:DataRelation ParentDataViewID="dvVerificationSummary" ParentColumns="ParentEscalatorID" ChildDataViewID"dvVerificationDetails" ChildColumns="EscalatorID" />') is not allowed within a 'Infragistics.Web.UI.DataSourceControls.DataRelationCollection'.
I'm using the simple examples that are all over the web, so its not anything complex. I've also seen that there are older posts with similar errors on other controls. The few solutions that I saw leaned toward the way the .dll was registered. I don't see anything off with that either. Any help will be greatly appreciated!Thanks, Tami
Here is my code:
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPages/Menu.Master" CodeBehind="BudgetVerification_SumDetails.aspx.cs" Inherits="WebSite.BudgetSetup.BudgetVerification_SumDetails" %>
<%@ Register Assembly="Infragistics35.Web.v10.2, Version=10.2.20102.1011, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.DataSourceControls" TagPrefix="igds" %><%@ Register TagPrefix="uc" TagName="Confirm" Src="~/UserControls/Confirm.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server" ><div id="divVerification"> <igmisc:WebAsyncRefreshPanel ID="warpVerification" runat="server" Height="390px" Width="1075px"> <table id="tblVerification" style="width: 100%" cellspacing="5px"> <tr> <td colspan="2" align="center"> <ig:WebHierarchicalDataGrid ID="grdVerification" runat="server" Height="380px" Width="100%" StyleSetPath="../Stylesheets/" StyleSetName="Default" AutoGenerateBands="true" AutoGenerateColumns="true" DataSourceID="whdsVerification"> <ExpandCollapseAnimation SlideOpenDirection="Auto" SlideOpenDuration="300" SlideCloseDirection="Auto" SlideCloseDuration="300" />
</ig:WebHierarchicalDataGrid> <igds:WebHierarchicalDataSource ID="whdsVerification" runat="server"> <DataRelations> <igds:DataRelation ParentDataViewID="dvVerificationSummary" ParentColumns="ParentEscalatorID" ChildDataViewID"dvVerificationDetails" ChildColumns="EscalatorID" /> </DataRelations> <DataViews> <igds:DataView ID="dvVerificationSummary" DataSourceID="dsrcVerificationSummary" /> <igds:DataView ID="dvVerificationDetails" DataSourceID="dsrcVerificationDetails" /> </DataViews> </igds:WebHierarchicalDataSource> <asp:ObjectDataSource ID="dsrcVerificationSummary" runat="server" SelectMethod="GetBudgetVerificationByBudgetID_Summary" TypeName="PFOM.Business.BudgetSetupManager" onselecting="dsrcVerification_Selecting"> <SelectParameters> <asp:Parameter DefaultValue="" Name="budgetID" Type="Int32" /> </SelectParameters> </asp:ObjectDataSource> <asp:ObjectDataSource ID="dsrcVerificationDetails" runat="server" SelectMethod="GetBudgetVerificationByBudgetID_pivot" TypeName="PFOM.Business.BudgetSetupManager" onselecting="dsrcVerification_Selecting"> <SelectParameters> <asp:Parameter DefaultValue="" Name="budgetID" Type="Int32" /> </SelectParameters> </asp:ObjectDataSource>
</td> </tr> </table> </igmisc:WebAsyncRefreshPanel> </div></asp:Content>
Sorry for the delay, I was on vacation. In the attached example, the page will call the summary datasource 3 times and the details datasource 2 times on load. Then, when you click to expand, it will call the details 2 more times and the summary 1 time. As far as display goes, it all looks good and acts like I want, but all of the calls are a concern for performance when this is used in production.
Thanks,
Tami
Hi, could you attach your aspx and code behind so I can see how you are data binding?
thanks,Dave
Thank you! Always nice when someone points out your stupid moves. ha! I added the = sign and removed the WebAsyncRefreshPanel. I am able to get the grid to display now; however, each of my datasources gets called 3 times while loading and then when I click on the expand row, it tries to call the summary datasource again. Why is it calling it so many times if it already has the data it needs?
Hi, Assuming you copied this code from your aspx, your problem is in bold. You are missing the '=' sign in ChildDataViewID. Also seem to be missing an Id, but not sure if that's required.
<DataRelations> <igds:DataRelation ParentDataViewID="dvVerificationSummary" ParentColumns="ParentEscalatorID" ChildDataViewID"dvVerificationDetails" ChildColumns="EscalatorID" /> </DataRelations>
As an aside, you might run into problems withe the WHDG inside the WebAsyncRefreshPanel. WHDG uses Microsoft ajax, whereas the WARP uses its own implementation. These can conflict. If you have problems, switch to an Update Panel.
regards,David Young