Hi,
I'm new to telerik and am getting a weird 'Expression of type 'Boolean' expected ' error when I try to load the following hierarchy page code:
Basically I've got a many-to-many table mapping products to special occasions. I'm trying to have an outter grid with the products and an inner-grid where the users can add or delete the special occasion relationships. The code works if I remove the parenttablerelation and where clauses from linqdatasource2, but throws that weird bool error when I try to add them back in. There are no bool values in the linqdatasource2 table so not sure where that value is coming from.
Does anyone see something in my code that could be causing issues? Or is this scenario just not possible with radgrid and linq?
I'm new to telerik and am getting a weird 'Expression of type 'Boolean' expected ' error when I try to load the following hierarchy page code:
| <%--datasource for product radgrid--%> |
| <asp:LinqDataSource ID="LinqDataSource1" runat="server" |
| ContextTypeName="DataClassesDataContext" |
| TableName="Products" |
| Select="new (id, name)" |
| OrderBy="name"> |
| </asp:LinqDataSource> |
| <%--product data grid--%> |
| <telerik:radgrid ID="RadGrid1" runat="server" |
| AllowPaging="True" |
| AllowSorting="True" |
| AutoGenerateColumns="False" |
| GridLines="None" |
| DataSourceID="LinqDataSource1" |
| DataMember="DefaultView" |
| ShowFooter="True" |
| ShowStatusBar="True" > |
| <PagerStyle Mode="NumericPages" AlwaysVisible="true" /> |
| <MasterTableView |
| AutoGenerateColumns="False" |
| DataMember="DefaultView" |
| DataKeyNames="id" |
| DataSourceID="LinqDataSource1" |
| PageSize="10" |
| EditMode="PopUp" |
| HierarchyLoadMode="ServerOnDemand"> |
| <NestedViewTemplate> |
| <asp:Panel runat="server" ID="InnerContainer"> |
| <%--datasources for inner radgrid--%> |
| <asp:LinqDataSource ID="LinqDataSource2" runat="server" |
| EnableDelete="True" |
| EnableUpdate="True" |
| ContextTypeName="DataClassesDataContext" |
| TableName="ProductToSpecialOccasions" |
| Select="new (id, ProductID, SpecialOccasionID)" |
| OrderBy="ProductID" |
| Where="ProductID equals @ProductID"> |
| <WhereParameters> |
| <asp:Parameter Name="ProductID" Type="Int64" /> |
| </WhereParameters> |
| </asp:LinqDataSource> |
| <%--relationship data grid--%> |
| <telerik:radgrid ID="RadGrid2" runat="server" |
| AllowPaging="True" |
| AllowSorting="True" |
| AllowAutomaticInserts="True" |
| AllowAutomaticDeletes="True" |
| AutoGenerateColumns="False" |
| GridLines="None" |
| DataSourceID="LinqDataSource2" |
| DataMember="DefaultView" |
| ShowFooter="True" |
| ShowStatusBar="True"> |
| <PagerStyle Mode="NumericPages" AlwaysVisible="true" /> |
| <MasterTableView |
| AutoGenerateColumns="False" |
| DataKeyNames="id" |
| PageSize="10" |
| EditMode="InPlace" |
| CommandItemDisplay="Top"> |
| <DetailTables> |
| <telerik:GridTableView DataSourceID="LinqDataSource2" Width="100%" runat="server"> |
| <ParentTableRelation> |
| <telerik:GridRelationFields DetailKeyField="ParentID" MasterKeyField="id" /> |
| </ParentTableRelation> |
| </telerik:GridTableView> |
| </DetailTables> |
| <Columns> |
| <telerik:GridBoundColumn |
| UniqueName="id" |
| DataField="id" |
| DataType="System.Int64" |
| HeaderText="id" |
| ReadOnly="True" |
| SortExpression="id"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn |
| UniqueName="ProductID" |
| DataField="ProductID" |
| DataType="System.Int64" |
| HeaderText="ProductID" |
| SortExpression="ProductID"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn |
| UniqueName="SpecialOccasionID" |
| DataField="SpecialOccasionID" |
| DataType="System.Int64" |
| HeaderText="SpecialOccasionID" |
| SortExpression="SpecialOccasionID"> |
| </telerik:GridBoundColumn> |
| <telerik:GridButtonColumn ConfirmText="Delete this relationship?" ConfirmDialogType="RadWindow" |
| ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" |
| UniqueName="DeleteColumn"> |
| <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> |
| </telerik:GridButtonColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:radgrid> |
| </asp:Panel> |
| </NestedViewTemplate> |
| <ExpandCollapseColumn Visible="True"></ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn |
| UniqueName="id" |
| DataField="id" |
| DataType="System.Int64" |
| HeaderText="id" |
| ReadOnly="True" |
| SortExpression="id"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn |
| UniqueName="name" |
| DataField="name" |
| DataType="System.Int64" |
| HeaderText="name" |
| ReadOnly="True" |
| SortExpression="name"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:radgrid> |
Basically I've got a many-to-many table mapping products to special occasions. I'm trying to have an outter grid with the products and an inner-grid where the users can add or delete the special occasion relationships. The code works if I remove the parenttablerelation and where clauses from linqdatasource2, but throws that weird bool error when I try to add them back in. There are no bool values in the linqdatasource2 table so not sure where that value is coming from.
Does anyone see something in my code that could be causing issues? Or is this scenario just not possible with radgrid and linq?