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

Adding aggregate causes "cannot find column" on Filtering

3 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 02 Mar 2015, 09:21 AM
If I add the following aggregate to my Grid...

Aggregate="Sum" DataFormatString="{0:C}" FooterAggregateFormatString="<b>{0:C}</b>"

... and then filter, I get the following error

Sys.WebForms.PageRequestManagerServerErrorException: Cannot find column [it.DivisionID].

This is using an Entity Data Source. 

How do I fix?

Full column specification (Division column was the example Filter column):

<telerik:GridDropDownColumn UniqueName="Division" HeaderText="Division" DataField="DivisionID" DataSourceID="edsDivision" ListValueField="DivisionID" ListTextField="Division1" SortExpression="Division.Division1" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" ReadOnly="true" FilterControlWidth="90px">
                    <HeaderStyle Width="100px" />
                    <ItemStyle Width="100px" />
                    <FilterTemplate>
                        <telerik:RadComboBox ID="ddlDivision" DataSourceID="edsDivision" DataValueField="DivisionID" DataTextField="Division1"
                            Height="200px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Division").CurrentFilterValue %>'
                            runat="server" OnClientSelectedIndexChanged="DivisionChanged" Width="80px">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                            <script type="text/javascript">
                                function DivisionChanged(sender, args) {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                    tableView.filter("Division", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridDropDownColumn>

<telerik:GridNumericColumn UniqueName="DebtAgeCurrent" DataField="DebtAgeCurrent" SortExpression="DebtAgeCurrent" HeaderText="Current Debt" ShowFilterIcon="true" ReadOnly="true" CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" NumericType="Currency" FilterControlWidth="55px"
                    Aggregate="Sum" DataFormatString="{0:C}" FooterAggregateFormatString="<b>{0:C}</b>">
                    <HeaderStyle Width="100px" />
                    <ItemStyle Width="100px" />
                </telerik:GridNumericColumn>


3 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
answered on 02 Mar 2015, 09:24 AM
I should add, that I'm also appending custom filters to my Entity Data Source's WHERE clause as per this article: http://www.telerik.com/forums/grid-filter-and-the-entitydatasource-control-whereparameters
0
Angel Petrov
Telerik team
answered on 04 Mar 2015, 03:49 PM
Hello,

I have already provided an answer in the official support ticket you have opened regarding this matter. Once we are able to find the culprit behind this behavior you can share our findings with the community thus helping other members overwhelm such types of issues.

Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Peter
Top achievements
Rank 1
answered on 09 Mar 2015, 06:34 AM
Two issues here:

1. Needed to set EnableLinqExpressions to TRUE
2. Bizarrely, needed to remove manually DataBound entities (bound to data from the ASP.NET cache). Had to revert to using an EntityDataSource for these items as well. Unclear why these issues are linked.

Anyway, fixed. Thanks. 
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
Angel Petrov
Telerik team
Share this question
or