This is a migrated thread and some comments may be shown as answers.

Trouble with FilterExpression and ObjectDataSource

3 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 12 Jul 2011, 03:27 PM
I have a page with three RadGrid controls on it.  The idea was to map records from two of the RadGrids to the main one using row drag and drop.  The row drag and drop portion works really well.  However, when I try to filter the grids, the FilterExpression property comes back as a T-SQL expression rather than a Linq Expression.  The property 'EnableLinqExpressions' has been set to 'true' for all grids.  The Data Sources used for the RadGrid controls are ObjectDataSource objects.  The main RadGrid also has two sub-Grids that expand out, however those are populated using the 'DetailTableDataBind' event rather than using a DataSource.

Is there some setting I am missing?  Below are some code samples:

ASP.NET
<asp:ObjectDataSource ID="LineItemGroupObjectDataSource" runat="server" EnablePaging="True"
        OldValuesParameterFormatString="original_{0}" OnSelected="LineItemGroupObjectDataSource_Selected"
        OnSelecting="LineItemGroupObjectDataSource_Selecting" SelectCountMethod="GetLineItemGroupCount"
        SelectMethod="GetLineItemGroups" SortParameterName="sortExpression" TypeName="Telarix.IxTools.IxAudit.Web.ObjectDataSources">
        <SelectParameters>
            <asp:Parameter Name="filterExpression" Type="String" ConvertEmptyStringToNull="true" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="UnmappedIncomingLineItemObjectDataSource" runat="server"
        EnablePaging="True" OldValuesParameterFormatString="original_{0}" SelectCountMethod="GetUnmappedIncomingLineItemCount"
        SelectMethod="GetUnmappedIncomingLineItems" SortParameterName="sortExpression"
        TypeName="Telarix.IxTools.IxAudit.Web.ObjectDataSources" OnSelected="UnmappedIncomingLineItemObjectDataSource_Selected"
        OnSelecting="UnmappedIncomingLineItemObjectDataSource_Selecting">
        <SelectParameters>
            <asp:Parameter Name="filterExpression" Type="String" ConvertEmptyStringToNull="true" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="UnmappedExpectedLineItemObjectDataSource" runat="server"
        EnablePaging="True" OldValuesParameterFormatString="original_{0}" SelectCountMethod="GetUnmappedExpectedLineItemCount"
        SelectMethod="GetUnmappedExpectedLineItems" SortParameterName="sortExpression"
        TypeName="Telarix.IxTools.IxAudit.Web.ObjectDataSources" OnSelected="UnmappedExpectedLineItemObjectDataSource_Selected"
        OnSelecting="UnmappedExpectedLineItemObjectDataSource_Selecting">
        <SelectParameters>
            <asp:Parameter Name="filterExpression" Type="String" ConvertEmptyStringToNull="true" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <div id="container">
        <asp:Panel ID="MainPanel" runat="server">
            <div id="PageButtons" style="float: right; padding: 10px">
                <asp:LinkButton ID="btnSaveContinue" runat="server" CssClass="button" OnClick="SaveContinue_Click"
                    Style="margin: 0px 2px 0px 0px"><span>Save & Continue</span></asp:LinkButton>
                <asp:LinkButton ID="btnSaveClose" runat="server" CssClass="button" OnClick="SaveClose_Click"
                    Style="margin: 0px 2px 0px 2px"><span>Save & Close</span></asp:LinkButton>
                <asp:LinkButton ID="btnExportExcel" runat="server" CssClass="button" CausesValidation="false"
                    OnClick="ExportExcel_Click" Style="margin: 0px 2px 0px 2px"><span>Export to Excel</span></asp:LinkButton>
                <asp:LinkButton ID="btnCancel" runat="server" CssClass="button" OnClick="Cancel_Click"
                    Style="margin: 0px 2px 0px 2px"><span>Close</span></asp:LinkButton>
                <asp:LinkButton ID="btnUndo" runat="server" CssClass="button" OnClick="Undo_Click"
                    Style="margin: 0px 0px 0px 2px"><span>Undo</span></asp:LinkButton>
            </div>
            <div class="clear">
            </div>
            <div id="MappedItemsSection" style="padding: 10px">
                <table class="dash" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <img src="Common/images/chartHeaderLeft.gif" alt="" />
                        </td>
                        <td class="title">
                            Line Item Groups
                        </td>
                        <td>
                            <img src="Common/images/chartHeaderRight.gif" alt="" />
                        </td>
                    </tr>
                </table>
                <asp:Panel ID="MappedItemsGridPanel" runat="server" CssClass="boxLayer" Style="margin-bottom: 20px;">
                    <table>
                        <tr>
                            <td align="left">
                                <telerik:RadGrid ID="LineItemGroupRadGrid" runat="server" AllowFilteringByColumn="True"
                                    AllowPaging="True" AllowSorting="True" OnItemCommand="LineItemGroupRadGrid_ItemCommand"
                                    DataSourceID="LineItemGroupObjectDataSource" PageSize="5" AutoGenerateColumns="False"
                                    GroupingEnabled="False" OnPreRender="LineItemGroupRadGrid_PreRender" OnDeleteCommand="LineItemGroupRadGrid_DeleteCommand"
                                    EnableHeaderContextMenu="True" OnDetailTableDataBind="LineItemGroupRadGrid_DetailTableDataBind"
                                    GridLines="None">
                                    <ValidationSettings EnableValidation="False" />
                                    <MasterTableView AllowMultiColumnSorting="True" DataKeyNames="lineItemGroupIndex,lineItemGroupId"
                                        HierarchyLoadMode="ServerBind" DataSourceID="LineItemGroupObjectDataSource" GridLines="Both"
                                        Name="LineItemGroups" NoDetailRecordsText="No mapped line items for this group"
                                        NoMasterRecordsText="No line items have been mapped.">
                                        <SortExpressions>
                                            <telerik:GridSortExpression FieldName="Name" SortOrder="Ascending" />
                                        </SortExpressions>
                                        <DetailTables>
                                            <telerik:GridTableView runat="server" AllowMultiColumnSorting="True" AllowFilteringByColumn="False"
                                                DataKeyNames="lineItemGroupIndex,lineItemGroupId" Frame="LHS" GridLines="Both"
                                                HorizontalAlign="Left" Name="MappedExpectedLineItems" NoDetailRecordsText="No Mapped Internal Line Items"
                                                NoMasterRecordsText="No Mapped Internal Line Items" Width="49%">
                                                <ParentTableRelation>
                                                    <telerik:GridRelationFields DetailKeyField="lineItemGroupId" MasterKeyField="lineItemGroupId" />
                                                </ParentTableRelation>
                                                <SortExpressions>
                                                    <telerik:GridSortExpression FieldName="Product" SortOrder="Ascending" />
                                                    <telerik:GridSortExpression FieldName="TimeBand" SortOrder="Ascending" />
                                                    <telerik:GridSortExpression FieldName="Tier" SortOrder="Ascending" />
                                                </SortExpressions>
                                                <Columns>
                                                    <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                        DataField="lineItemGroupIndex" DataType="System.Int32" Display="False" Groupable="False"
                                                        GroupByExpression="lineItemGroupIndex" HeaderText="Line Item Group Index" ReadOnly="True"
                                                        SortExpression="lineItemGroupIndex" UniqueName="lineItemGroupIndex" Visible="False">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                        DataField="lineItemGroupId" DataType="System.Int32" Display="False" Groupable="False"
                                                        GroupByExpression="lineItemGroupId" HeaderText="line Item Group Id" ReadOnly="True"
                                                        SortExpression="lineItemGroupId" UniqueName="lineItemGroupId" Visible="False">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                        DataField="LineItemIndex" DataType="System.Int32" Display="False" Groupable="False"
                                                        GroupByExpression="LineItemIndex" HeaderText="Line Item Index" ReadOnly="True"
                                                        SortExpression="LineItemIndex" UniqueName="LineItemIndex" Visible="False">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                        DataField="LineItemId" DataType="System.Int32" Display="False" Groupable="False"
                                                        GroupByExpression="LineItemId" HeaderText="Line Item Id" ReadOnly="True" SortExpression="LineItemId"
                                                        UniqueName="LineItemId" Visible="False">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridBoundColumn Aggregate="Count" AutoPostBackOnFilter="True" CurrentFilterFunction="StartsWith"
                                                        DataField="Product" GroupByExpression="Product" HeaderText="(Internal) Product"
                                                        ReadOnly="True" SortExpression="Product" UniqueName="Product">
                                                        <HeaderStyle Width="20%" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn Aggregate="Count" DataField="TimeBand" GroupByExpression="TimeBand"
                                                        HeaderText="Time Band" ReadOnly="True" SortExpression="TimeBand" UniqueName="TimeBand">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn Aggregate="Count" DataField="Tier" GroupByExpression="Tier"
                                                        HeaderText="Tier" ReadOnly="True" SortExpression="Tier" UniqueName="Tier">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridDateTimeColumn Aggregate="Min" DataField="BeginDate" DataFormatString="{0:d}"
                                                        DataType="System.DateTime" GroupByExpression="BeginDate" HeaderText="Begin Date"
                                                        ReadOnly="True" SortExpression="BeginDate" UniqueName="BeginDate">
                                                    </telerik:GridDateTimeColumn>
                                                    <telerik:GridDateTimeColumn Aggregate="Max" DataField="EndDate" DataFormatString="{0:d}"
                                                        DataType="System.DateTime" GroupByExpression="EndDate" HeaderText="End Date"
                                                        ReadOnly="True" SortExpression="EndDate" UniqueName="EndDate">
                                                    </telerik:GridDateTimeColumn>
                                                    <telerik:GridNumericColumn Aggregate="Sum" DataField="Calls" DataType="System.Int32"
                                                        GroupByExpression="Calls" HeaderText="Calls" ReadOnly="True" SortExpression="Calls"
                                                        UniqueName="Calls">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Sum" DataField="Units" DataFormatString="{0:N2}"
                                                        DataType="System.Decimal" GroupByExpression="Units" HeaderText="Units" ReadOnly="True"
                                                        SortExpression="Units" UniqueName="Units">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Avg" DataField="Rate" DataFormatString="{0:N6}"
                                                        DataType="System.Decimal" GroupByExpression="Rate" HeaderText="Rate" ReadOnly="True"
                                                        SortExpression="Rate" UniqueName="Rate">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Sum" DataField="Amount" DataFormatString="{0:N2}"
                                                        DataType="System.Decimal" GroupByExpression="Amount" HeaderText="Amount" ReadOnly="True"
                                                        SortExpression="Amount" UniqueName="Amount">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmDialogType="RadWindow"
                                                        ConfirmText="This action will remove the selected mapped line item from the group"
                                                        ConfirmTitle="Remove Mapped Line Item" ImageUrl="~/Common/images/deleterow.gif"
                                                        UniqueName="RemoveButton">
                                                        <HeaderStyle Width="30px" />
                                                    </telerik:GridButtonColumn>
                                                </Columns>
                                                <PagerStyle Mode="NextPrev" />
                                            </telerik:GridTableView>
                                            <telerik:GridTableView runat="server" AllowMultiColumnSorting="True" AllowFilteringByColumn="False"
                                                DataKeyNames="lineItemGroupIndex,lineItemGroupId" Frame="RHS" HorizontalAlign="Right"
                                                Name="MappedIncomingLineItems" NoDetailRecordsText="No Mapped Received Line Items"
                                                NoMasterRecordsText="No Mapped Received Line Items" Width="49%">
                                                <ParentTableRelation>
                                                    <telerik:GridRelationFields DetailKeyField="lineItemGroupId" MasterKeyField="lineItemGroupId" />
                                                </ParentTableRelation>
                                                <SortExpressions>
                                                    <telerik:GridSortExpression FieldName="Product" SortOrder="Ascending" />
                                                    <telerik:GridSortExpression FieldName="TimeBand" SortOrder="Ascending" />
                                                    <telerik:GridSortExpression FieldName="Tier" SortOrder="Ascending" />
                                                </SortExpressions>
                                                <Columns>
                                                    <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                        DataField="lineItemGroupIndex" DataType="System.Int32" Display="False" Groupable="False"
                                                        GroupByExpression="lineItemGroupIndex" HeaderText="Line Item Group Index" ReadOnly="True"
                                                        SortExpression="lineItemGroupIndex" UniqueName="lineItemGroupIndex" Visible="False">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                        DataField="lineItemGroupId" DataType="System.Int32" Display="False" Groupable="False"
                                                        GroupByExpression="lineItemGroupId" HeaderText="line Item Group Id" ReadOnly="True"
                                                        SortExpression="lineItemGroupId" UniqueName="lineItemGroupId" Visible="False">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                        DataField="LineItemIndex" DataType="System.Int32" Display="False" Groupable="False"
                                                        GroupByExpression="LineItemIndex" HeaderText="Line Item Index" ReadOnly="True"
                                                        SortExpression="LineItemIndex" UniqueName="LineItemIndex" Visible="False">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                        DataField="LineItemId" DataType="System.Int32" Display="False" Groupable="False"
                                                        GroupByExpression="LineItemId" HeaderText="Line Item Id" ReadOnly="True" SortExpression="LineItemId"
                                                        UniqueName="LineItemId" Visible="False">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridBoundColumn Aggregate="Count" AutoPostBackOnFilter="True" CurrentFilterFunction="StartsWith"
                                                        DataField="Product" GroupByExpression="Product" HeaderText="(Received) Product"
                                                        ReadOnly="True" SortExpression="Product" UniqueName="Product">
                                                        <HeaderStyle Width="20%" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn Aggregate="Count" DataField="TimeBand" GroupByExpression="TimeBand"
                                                        HeaderText="Time Band" ReadOnly="True" SortExpression="TimeBand" UniqueName="TimeBand">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn Aggregate="Count" DataField="Tier" GroupByExpression="Tier"
                                                        HeaderText="Tier" ReadOnly="True" SortExpression="Tier" UniqueName="Tier">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridDateTimeColumn Aggregate="Min" DataField="BeginDate" DataFormatString="{0:d}"
                                                        DataType="System.DateTime" GroupByExpression="BeginDate" HeaderText="Begin Date"
                                                        ReadOnly="True" SortExpression="BeginDate" UniqueName="BeginDate">
                                                    </telerik:GridDateTimeColumn>
                                                    <telerik:GridDateTimeColumn Aggregate="Max" DataField="EndDate" DataFormatString="{0:d}"
                                                        DataType="System.DateTime" GroupByExpression="EndDate" HeaderText="End Date"
                                                        ReadOnly="True" SortExpression="EndDate" UniqueName="EndDate">
                                                    </telerik:GridDateTimeColumn>
                                                    <telerik:GridNumericColumn Aggregate="Sum" DataField="Calls" DataType="System.Int32"
                                                        GroupByExpression="Calls" HeaderText="Calls" ReadOnly="True" SortExpression="Calls"
                                                        UniqueName="Calls">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Sum" DataField="Units" DataFormatString="{0:N2}"
                                                        DataType="System.Decimal" GroupByExpression="Units" HeaderText="Units" ReadOnly="True"
                                                        SortExpression="Units" UniqueName="Units">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Avg" DataField="Rate" DataFormatString="{0:N6}"
                                                        DataType="System.Decimal" GroupByExpression="Rate" HeaderText="Rate" ReadOnly="True"
                                                        SortExpression="Rate" UniqueName="Rate">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridNumericColumn Aggregate="Sum" DataField="Amount" DataFormatString="{0:N2}"
                                                        DataType="System.Decimal" GroupByExpression="Amount" HeaderText="Amount" ReadOnly="True"
                                                        SortExpression="Amount" UniqueName="Amount">
                                                    </telerik:GridNumericColumn>
                                                    <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmDialogType="RadWindow"
                                                        ConfirmText="This action will remove the selected mapped line item from the group"
                                                        ConfirmTitle="Remove Mapped Line Item" ImageUrl="~/Common/images/deleterow.gif"
                                                        UniqueName="RemoveButton">
                                                        <HeaderStyle Width="30px" />
                                                    </telerik:GridButtonColumn>
                                                </Columns>
                                                <PagerStyle Mode="NextPrev" />
                                            </telerik:GridTableView>
                                        </DetailTables>
                                        <ExpandCollapseColumn Visible="True">
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                DataField="lineItemGroupIndex" DataType="System.Int32" Display="False" Groupable="False"
                                                GroupByExpression="lineItemGroupIndex" HeaderText="Line Item Group Index" ReadOnly="True"
                                                SortExpression="lineItemGroupIndex" UniqueName="lineItemGroupIndex" Visible="False">
                                            </telerik:GridNumericColumn>
                                            <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                DataField="lineItemGroupId" DataType="System.Int32" Display="False" Groupable="False"
                                                GroupByExpression="lineItemGroupId" HeaderText="Line Item Group Id" ReadOnly="True"
                                                SortExpression="lineItemGroupId" UniqueName="lineItemGroupId" Visible="False">
                                            </telerik:GridNumericColumn>
                                            <telerik:GridBoundColumn Aggregate="Count" AutoPostBackOnFilter="True" CurrentFilterFunction="StartsWith"
                                                DataField="Name" GroupByExpression="Name" HeaderText="Name" ReadOnly="True" SortExpression="Name"
                                                UniqueName="Name" FilterControlWidth="90%">
                                                <HeaderStyle Width="20%" />
                                            </telerik:GridBoundColumn>
                                            <telerik:GridDateTimeColumn Aggregate="Min" DataField="BeginDate" AllowFiltering="false"
                                                DataFormatString="{0:d}" DataType="System.DateTime" GroupByExpression="BeginDate"
                                                HeaderText="Begin Date" ReadOnly="True" SortExpression="BeginDate" UniqueName="BeginDate"
                                                FilterControlWidth="75%">
                                            </telerik:GridDateTimeColumn>
                                            <telerik:GridDateTimeColumn Aggregate="Max" DataField="EndDate" AllowFiltering="false"
                                                DataFormatString="{0:d}" DataType="System.DateTime" GroupByExpression="EndDate"
                                                HeaderText="End Date" ReadOnly="True" SortExpression="EndDate" UniqueName="EndDate"
                                                FilterControlWidth="75%">
                                            </telerik:GridDateTimeColumn>
                                            <telerik:GridNumericColumn Aggregate="Sum" DataField="TotalExpectedCalls" AllowFiltering="false"
                                                DataType="System.Int32" Groupable="False" GroupByExpression="TotalExpectedCalls"
                                                HeaderText="Internal Calls" ReadOnly="True" SortExpression="TotalExpectedCalls"
                                                UniqueName="TotalExpectedCalls">
                                            </telerik:GridNumericColumn>
                                            <telerik:GridNumericColumn Aggregate="Sum" AllowRounding="True" AllowFiltering="false"
                                                DataField="TotalExpectedUnits" DataFormatString="{0:N2}" DataType="System.Decimal"
                                                Groupable="False" GroupByExpression="TotalExpectedUnits" HeaderText="Internal Units"
                                                ReadOnly="True" SortExpression="TotalExpectedUnits" UniqueName="TotalExpectedUnits">
                                            </telerik:GridNumericColumn>
                                            <telerik:GridNumericColumn Aggregate="Avg" AllowRounding="True" AllowFiltering="false"
                                                DataField="ExpectedRate" DataFormatString="{0:N6}" DataType="System.Decimal"
                                                Groupable="False" GroupByExpression="ExpectedRate" HeaderText="Internal Rate"
                                                ReadOnly="True" SortExpression="ExpectedRate" UniqueName="ExpectedRate">
                                            </telerik:GridNumericColumn>
                                            <telerik:GridNumericColumn Aggregate="Sum" AllowRounding="True" AllowFiltering="false"
                                                DataField="TotalExpectedAmount" DataFormatString="{0:N2}" DataType="System.Decimal"
                                                GroupByExpression="TotalExpectedAmount" HeaderText="Internal Amount" ReadOnly="True"
                                                SortExpression="TotalExpectedAmount" UniqueName="TotalExpectedAmount">
                                            </telerik:GridNumericColumn>
                                            <telerik:GridNumericColumn Aggregate="Sum" DataField="TotalIncomingCalls" AllowFiltering="false"
                                                DataType="System.Int32" Groupable="False" GroupByExpression="TotalIncomingCalls"
                                                HeaderText="Received Calls" ReadOnly="True" SortExpression="TotalIncomingCalls"
                                                UniqueName="TotalIncomingCalls">
                                            </telerik:GridNumericColumn>
                                            <telerik:GridNumericColumn Aggregate="Sum" AllowRounding="True" AllowFiltering="false"
                                                DataField="TotalIncomingUnits" DataFormatString="{0:N2}" DataType="System.Decimal"
                                                Groupable="False" GroupByExpression="TotalIncomingUnits" HeaderText="Received Units"
                                                ReadOnly="True" SortExpression="TotalIncomingUnits" UniqueName="TotalIncomingUnits">
                                            </telerik:GridNumericColumn>
                                            <telerik:GridNumericColumn Aggregate="Avg" AllowRounding="True" AllowFiltering="false"
                                                DataField="IncomingRate" DataFormatString="{0:N6}" DataType="System.Decimal"
                                                Groupable="False" GroupByExpression="IncomingRate" HeaderText="Received Rate"
                                                ReadOnly="True" SortExpression="IncomingRate" UniqueName="IncomingRate">
                                            </telerik:GridNumericColumn>
                                            <telerik:GridNumericColumn Aggregate="Sum" AllowRounding="True" AllowFiltering="false"
                                                DataField="TotalIncomingAmount" DataFormatString="{0:N2}" DataType="System.Decimal"
                                                GroupByExpression="TotalIncomingAmount" HeaderText="Received Amount" ReadOnly="True"
                                                SortExpression="TotalIncomingAmount" UniqueName="TotalIncomingAmount">
                                            </telerik:GridNumericColumn>
                                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmDialogType="RadWindow"
                                                ConfirmText="This action will delete the Line-Item Group and move the underlying line-items to the unmapped section"
                                                ConfirmTitle="Confirm Mapping Delete" HeaderButtonType="None" ImageUrl="~/Common/images/deleterow.gif"
                                                Reorderable="False" Resizable="False" ShowSortIcon="False" UniqueName="DeleteColumn">
                                                <HeaderStyle Width="30px" />
                                            </telerik:GridButtonColumn>
                                        </Columns>
                                        <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="Top" />
                                    </MasterTableView>
                                    <GroupingSettings CaseSensitive="False" />
                                    <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" AllowKeyboardNavigation="True"
                                        AllowRowHide="True" ReorderColumnsOnClient="True" AllowRowsDragDrop="True" EnableRowHoverStyle="True">
                                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />
                                        <Resizing AllowColumnResize="True" EnableRealTimeResize="True" />
                                    </ClientSettings>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
            <div class="clear">
            </div>
            <div style="text-align: center">
                <div>
                    <asp:Label ID="DragDropNewLabel" runat="server" Text="Drag to image for new grouping"></asp:Label>
                </div>
                <div>
                    <img id="DragDropNewGroup" src="Common/images/dropInsert.gif" alt="New Line Item Group"
                        runat="server" />
                </div>
            </div>
            <div id="UnmappedItemsSection">
                <div id="ExpectedLineItems" style="float: left; width: 48%; padding: 10px">
                    <table class="dash" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <img src="Common/images/chartHeaderLeft.gif" alt="" />
                            </td>
                            <td class="title">
                                Unmapped Internal Line Items
                            </td>
                            <td>
                                <img src="Common/images/chartHeaderRight.gif" alt="" />
                            </td>
                        </tr>
                    </table>
                    <asp:Panel ID="ExpectedLineItemPanel" CssClass="boxLayer" Style="margin-bottom: 20px"
                        runat="server">
                        <table style="width: 100%">
                            <tr align="left">
                                <td>
                                    <telerik:RadGrid ID="UnmappedExpectedLineItemRadGrid" runat="server" AllowFilteringByColumn="True"
                                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" EnableViewState="False"
                                        OnItemCommand="UnmappedExpectedLineItemRadGrid_ItemCommand" DataSourceID="UnmappedExpectedLineItemObjectDataSource"
                                        AllowMultiRowSelection="True" HorizontalAlign="Left" OnPreRender="UnmappedExpectedLineItemRadGrid_PreRender"
                                        PageSize="5" BorderStyle="None" OnRowDrop="UnmappedExpectedLineItemRadGrid_RowDrop"
                                        GroupingEnabled="False" GridLines="None">
                                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                                        </HeaderContextMenu>
                                        <ValidationSettings EnableValidation="False" />
                                        <MasterTableView DataSourceID="UnmappedExpectedLineItemObjectDataSource" AllowMultiColumnSorting="True"
                                            GridLines="Both" Name="Unmapped Internal Line Items" DataKeyNames="LineItemIndex,LineItemId"
                                            EnableHeaderContextMenu="True" NoMasterRecordsText="No unmapped internal line items">
                                            <CommandItemSettings ExportToPdfText="Export to Pdf" />
                                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                            </RowIndicatorColumn>
                                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                            </ExpandCollapseColumn>
                                            <SortExpressions>
                                                <telerik:GridSortExpression FieldName="Product" SortOrder="Ascending" />
                                                <telerik:GridSortExpression FieldName="TimeBand" SortOrder="Ascending" />
                                                <telerik:GridSortExpression FieldName="Tier" SortOrder="Ascending" />
                                            </SortExpressions>
                                            <Columns>
                                                <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                    DataField="LineItemIndex" DataType="System.Int32" Display="False" Groupable="False"
                                                    GroupByExpression="LineItemIndex" HeaderText="Line Item Index" ReadOnly="True"
                                                    SortExpression="LineItemIndex" UniqueName="LineItemIndex" Visible="False">
                                                </telerik:GridNumericColumn>
                                                <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                    DataField="LineItemId" DataType="System.Int32" Display="False" Groupable="False"
                                                    GroupByExpression="LineItemId" HeaderText="Line Item Id" ReadOnly="True" SortExpression="LineItemId"
                                                    UniqueName="LineItemId" Visible="False">
                                                </telerik:GridNumericColumn>
                                                <telerik:GridBoundColumn Aggregate="Count" AutoPostBackOnFilter="True" CurrentFilterFunction="StartsWith"
                                                    DataField="Product" GroupByExpression="Product" HeaderText="Product" ReadOnly="True"
                                                    SortExpression="Product" UniqueName="Product">
                                                    <HeaderStyle Width="20%" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn Aggregate="Count" AllowFiltering="False" DataField="TimeBand"
                                                    GroupByExpression="TimeBand" HeaderText="Time Band" ReadOnly="True" SortExpression="TimeBand"
                                                    UniqueName="TimeBand">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn Aggregate="Count" AllowFiltering="False" DataField="Tier"
                                                    GroupByExpression="Tier" HeaderText="Tier" ReadOnly="True" SortExpression="Tier"
                                                    UniqueName="Tier">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridDateTimeColumn Aggregate="Min" AllowFiltering="false" DataField="BeginDate"
                                                    DataFormatString="{0:d}" DataType="System.DateTime" GroupByExpression="BeginDate"
                                                    HeaderText="Begin Date" ReadOnly="True" SortExpression="BeginDate" UniqueName="BeginDate">
                                                </telerik:GridDateTimeColumn>
                                                <telerik:GridDateTimeColumn Aggregate="Max" AllowFiltering="false" DataField="EndDate"
                                                    DataFormatString="{0:d}" DataType="System.DateTime" GroupByExpression="EndDate"
                                                    HeaderText="End Date" ReadOnly="True" SortExpression="EndDate" UniqueName="EndDate">
                                                </telerik:GridDateTimeColumn>
                                                <telerik:GridNumericColumn Aggregate="Sum" AllowFiltering="false" DataField="Calls"
                                                    DataType="System.Int32" GroupByExpression="Calls" HeaderText="Calls" ReadOnly="True"
                                                    SortExpression="Calls" UniqueName="Calls">
                                                </telerik:GridNumericColumn>
                                                <telerik:GridNumericColumn Aggregate="Sum" AllowFiltering="false" DataField="Units"
                                                    DataFormatString="{0:F2}" DataType="System.Decimal" GroupByExpression="Units"
                                                    HeaderText="Units" ReadOnly="True" SortExpression="Units" UniqueName="Units">
                                                </telerik:GridNumericColumn>
                                                <telerik:GridNumericColumn Aggregate="Avg" AllowFiltering="false" DataField="Rate"
                                                    DataFormatString="{0:F6}" DataType="System.Decimal" GroupByExpression="Rate"
                                                    HeaderText="Rate" ReadOnly="True" SortExpression="Rate" UniqueName="Rate">
                                                </telerik:GridNumericColumn>
                                                <telerik:GridNumericColumn Aggregate="Sum" AllowFiltering="false" DataField="Amount"
                                                    DataFormatString="{0:F2}" DataType="System.Decimal" GroupByExpression="Amount"
                                                    HeaderText="Amount" ReadOnly="True" SortExpression="Amount" UniqueName="Amount">
                                                </telerik:GridNumericColumn>
                                            </Columns>
                                            <EditFormSettings>
                                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                </EditColumn>
                                            </EditFormSettings>
                                            <PagerStyle Mode="NextPrev" Position="Top" />
                                        </MasterTableView>
                                        <GroupingSettings CaseSensitive="False" />
                                        <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" AllowKeyboardNavigation="True"
                                            AllowRowHide="True" ReorderColumnsOnClient="True" AllowRowsDragDrop="True" EnableRowHoverStyle="True">
                                            <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />
                                            <Resizing AllowColumnResize="True" EnableRealTimeResize="True" />
                                        </ClientSettings>
                                        <FilterMenu EnableImageSprites="False">
                                        </FilterMenu>
                                    </telerik:RadGrid>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </div>
                <div id="IncomingLineItems" style="float: right; width: 48%; padding: 10px">
                    <table class="dash" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <img src="Common/images/chartHeaderLeft.gif" alt="" />
                            </td>
                            <td class="title">
                                Unmapped Received Line Items
                            </td>
                            <td>
                                <img src="Common/images/chartHeaderRight.gif" alt="" />
                            </td>
                        </tr>
                    </table>
                    <asp:Panel ID="IncomingLineItemsPanel" CssClass="boxLayer" Style="margin-bottom: 20px"
                        runat="server">
                        <table style="width: 100%">
                            <tr align="left">
                                <td>
                                    <telerik:RadGrid ID="UnmappedIncomingLineItemRadGrid" runat="server" AllowFilteringByColumn="True"
                                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" EnableViewState="False"
                                        OnItemCommand="UnmappedIncomingLineItemRadGrid_ItemCommand" DataSourceID="UnmappedIncomingLineItemObjectDataSource"
                                        AllowMultiRowSelection="True" HorizontalAlign="Left" PageSize="5" OnPreRender="UnmappedIncomingLineItemRadGrid_PreRender"
                                        OnRowDrop="UnmappedIncomingLineItemRadGrid_RowDrop" GroupingEnabled="False" GridLines="None">
                                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                                        </HeaderContextMenu>
                                        <ValidationSettings EnableValidation="False" />
                                        <MasterTableView DataSourceID="UnmappedIncomingLineItemObjectDataSource" AllowMultiColumnSorting="True"
                                            GridLines="Both" Name="Unmapped Internal Line Items" DataKeyNames="LineItemIndex,LineItemId"
                                            EnableHeaderContextMenu="True" NoMasterRecordsText="No unmapped received line items">
                                            <CommandItemSettings ExportToPdfText="Export to Pdf" />
                                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                            </RowIndicatorColumn>
                                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                            </ExpandCollapseColumn>
                                            <SortExpressions>
                                                <telerik:GridSortExpression FieldName="Product" SortOrder="Ascending" />
                                                <telerik:GridSortExpression FieldName="TimeBand" SortOrder="Ascending" />
                                                <telerik:GridSortExpression FieldName="Tier" SortOrder="Ascending" />
                                            </SortExpressions>
                                            <Columns>
                                                <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                    DataField="LineItemIndex" DataType="System.Int32" Display="False" Groupable="False"
                                                    GroupByExpression="LineItemIndex" HeaderText="Line Item Index" ReadOnly="True"
                                                    SortExpression="LineItemIndex" UniqueName="LineItemIndex" Visible="False">
                                                </telerik:GridNumericColumn>
                                                <telerik:GridNumericColumn Aggregate="Count" AllowFiltering="False" AllowSorting="False"
                                                    DataField="LineItemId" DataType="System.Int32" Display="False" Groupable="False"
                                                    GroupByExpression="LineItemId" HeaderText="Line Item Id" ReadOnly="True" SortExpression="LineItemId"
                                                    UniqueName="LineItemId" Visible="False">
                                                </telerik:GridNumericColumn>
                                                <telerik:GridBoundColumn Aggregate="Count" AutoPostBackOnFilter="True" CurrentFilterFunction="StartsWith"
                                                    DataField="Product" GroupByExpression="Product" HeaderText="Product" ReadOnly="True"
                                                    SortExpression="Product" UniqueName="Product">
                                                    <HeaderStyle Width="20%" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn Aggregate="Count" AllowFiltering="False" DataField="TimeBand"
                                                    GroupByExpression="TimeBand" HeaderText="Time Band" ReadOnly="True" SortExpression="TimeBand"
                                                    UniqueName="TimeBand">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn Aggregate="Count" AllowFiltering="False" DataField="Tier"
                                                    GroupByExpression="Tier" HeaderText="Tier" ReadOnly="True" SortExpression="Tier"
                                                    UniqueName="Tier">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridDateTimeColumn Aggregate="Min" AllowFiltering="false" DataField="BeginDate"
                                                    DataFormatString="{0:d}" DataType="System.DateTime" GroupByExpression="BeginDate"
                                                    HeaderText="Begin Date" ReadOnly="True" SortExpression="BeginDate" UniqueName="BeginDate">
                                                </telerik:GridDateTimeColumn>
                                                <telerik:GridDateTimeColumn Aggregate="Max" AllowFiltering="false" DataField="EndDate"
                                                    DataFormatString="{0:d}" DataType="System.DateTime" GroupByExpression="EndDate"
                                                    HeaderText="End Date" ReadOnly="True" SortExpression="EndDate" UniqueName="EndDate">
                                                </telerik:GridDateTimeColumn>
                                                <telerik:GridNumericColumn Aggregate="Sum" AllowFiltering="false" DataField="Calls"
                                                    DataType="System.Int32" GroupByExpression="Calls" HeaderText="Calls" ReadOnly="True"
                                                    SortExpression="Calls" UniqueName="Calls">
                                                </telerik:GridNumericColumn>
                                                <telerik:GridNumericColumn Aggregate="Sum" AllowFiltering="false" DataField="Units"
                                                    DataFormatString="{0:F2}" DataType="System.Decimal" GroupByExpression="Units"
                                                    HeaderText="Units" ReadOnly="True" SortExpression="Units" UniqueName="Units">
                                                </telerik:GridNumericColumn>
                                                <telerik:GridNumericColumn Aggregate="Avg" AllowFiltering="false" DataField="Rate"
                                                    DataFormatString="{0:F6}" DataType="System.Decimal" GroupByExpression="Rate"
                                                    HeaderText="Rate" ReadOnly="True" SortExpression="Rate" UniqueName="Rate">
                                                </telerik:GridNumericColumn>
                                                <telerik:GridNumericColumn Aggregate="Sum" AllowFiltering="false" DataField="Amount"
                                                    DataFormatString="{0:F2}" DataType="System.Decimal" GroupByExpression="Amount"
                                                    HeaderText="Amount" ReadOnly="True" SortExpression="Amount" UniqueName="Amount">
                                                </telerik:GridNumericColumn>
                                            </Columns>
                                            <EditFormSettings>
                                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                </EditColumn>
                                            </EditFormSettings>
                                            <PagerStyle Mode="NextPrev" Position="Top" />
                                        </MasterTableView>
                                        <GroupingSettings CaseSensitive="False" />
                                        <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" AllowKeyboardNavigation="True"
                                            AllowRowHide="True" ReorderColumnsOnClient="True" AllowRowsDragDrop="True" EnableRowHoverStyle="True">
                                            <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />
                                            <Resizing AllowColumnResize="True" EnableRealTimeResize="True" />
                                        </ClientSettings>
                                        <FilterMenu EnableImageSprites="False">
                                        </FilterMenu>
                                    </telerik:RadGrid>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </div>
            </div>

Some of the Code Behind:
/// <summary>
 /// Handles the Init event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 protected void Page_Init(object sender, EventArgs e)
 {
     this.LineItemGroupRadGrid.Culture = CultureInfo.CurrentUICulture;
     this.LineItemGroupRadGrid.GridLines = GridLines.Both;
     this.UnmappedExpectedLineItemRadGrid.Culture = CultureInfo.CurrentUICulture;
     this.UnmappedExpectedLineItemRadGrid.GridLines = GridLines.Both;
     this.UnmappedIncomingLineItemRadGrid.Culture = CultureInfo.CurrentUICulture;
     this.UnmappedIncomingLineItemRadGrid.GridLines = GridLines.Both;
 }
 
 /// <summary>
 /// Page load event handler.
 /// </summary>
 /// <param name="sender">The event sender</param>
 /// <param name="e">The event arguments</param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         this.Response.Cache.SetCacheability(HttpCacheability.NoCache);
     }
 }
 
 /// <summary>
 /// Handles the DetailTableDataBind event for LineItemGroupRadGrid.
 /// </summary>
 /// <param name="source">The event source.</param>
 /// <param name="e">The event arguments.</param>
 protected void LineItemGroupRadGrid_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
 {
     GridDataItem parentItem = e.DetailTableView.ParentItem;
     int index = Convert.ToInt32(parentItem["lineItemGroupIndex"].Text, CultureInfo.InvariantCulture);
     int? id;
     int temp;
     if (int.TryParse(parentItem["lineItemGroupId"].Text, NumberStyles.Integer, CultureInfo.InvariantCulture, out temp))
     {
         id = temp;
     }
     else
     {
         id = null;
     }
 
     if (e.DetailTableView.Name == "MappedExpectedLineItems")
     {
         e.DetailTableView.DataSource = ObjectDataSources.GetMappedExpectedLineItems(0, int.MaxValue, e.DetailTableView.FilterExpression, e.DetailTableView.SortExpressions.GetSortString(), index, id);
     }
     else if (e.DetailTableView.Name == "MappedIncomingLineItems")
     {
         e.DetailTableView.DataSource = ObjectDataSources.GetMappedIncomingLineItems(0, int.MaxValue, e.DetailTableView.FilterExpression, e.DetailTableView.SortExpressions.GetSortString(), index, id);
     }
     else
     {
         e.Canceled = true;
     }
 }
  
 /// <summary>
 /// Event handler for the Selecting event of the LineItemGroupObjectDataSource object.
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="e">Event arguments.</param>
 protected void LineItemGroupObjectDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
 {
     e.InputParameters["filterExpression"] = this.LineItemGroupRadGrid.MasterTableView.FilterExpression;
}

Is there some setting that is interfering with the RadGrid creating a Linq Filter Expression instead of the T-SQL statement?

3 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 18 Jul 2011, 01:02 PM
Hello Ben,

I have examined your code and I did not see where the EnableLinqExpressions property is set to true. Please make sure that you set it.
Also, I would like to ask you to try the Q2 2011 version of the RadControls for ASP.NET AJAX.

If the issue persists, please send us the code of the SelectMethod of the ObjectDataSource.

Kind regards,
Mira
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Ben
Top achievements
Rank 1
answered on 18 Jul 2011, 01:21 PM
That property is true by default.  I don't have to explicitly set it in the code.

I've tested this out on other pages and I haven't found this issue.  However, for some reason, regardless of whether that property is true or false, the filter expression is coming back in T-SQL format.
0
Mira
Telerik team
answered on 20 Jul 2011, 02:49 PM
Hello Ben,

I tried to replicate the issue which you described, but to no avail.
Attached to this message, you will find the code which I used for testing.

If the issue persists, please open a formal support ticket and send us the problematic project.
Thank you in advance for the cooperation. 

Kind regards,
Mira
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
Ben
Top achievements
Rank 1
Answers by
Mira
Telerik team
Ben
Top achievements
Rank 1
Share this question
or