I get the error "Cannot find column [their_qty]" when I added a GridCalculatedColumn to my grid.
Here is the stack trace shown:
If I can use a GridNumericColumn for the same data field without a problem, but the presence of this particular column in a calculation is objectionable.
Here is an extract of the RadGrid declaration:
Remove "column4" and the grid displays fine. How can [their_qty] be ok in column2 but not column4?
This is the second error I received with this grid, but a search of the forum and adding EnableLinqExpressions="false" to the defenition fixed the earlier error "DataBinding: 'System.Data.Common.DataRecordInternal' does not contain a property with the name 'column4Result'."
Thanks.
Here is the stack trace shown:
| [EvaluateException: Cannot find column [their_qty].] |
| System.Data.NameNode.Bind(DataTable table, List`1 list) +1188205 |
| System.Data.DataExpression.Bind(DataTable table) +59 |
| System.Data.DataColumn.SetTable(DataTable table) +4828348 |
| System.Data.DataColumnCollection.BaseAdd(DataColumn column) +272 |
| System.Data.DataColumnCollection.AddAt(Int32 index, DataColumn column) +78 |
| System.Data.DataColumnCollection.Add(DataColumn column) +8 |
| Telerik.Web.UI.GridDataTableFromEnumerable.GetColumnsToUse() +2004 |
| Telerik.Web.UI.GridDataTableFromEnumerable.FillData() +1028 |
| Telerik.Web.UI.GridResolveEnumerable.Initialize() +55 |
| Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized() +40 |
| Telerik.Web.UI.GridResolveEnumerable.get_DataTable() +31 |
| Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, IEnumerable enumerable, Boolean CaseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +222 |
| Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +155 |
| Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields) +556 |
| Telerik.Web.UI.GridTableView.get_ResolvedDataSource() +219 |
| Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +73 |
| System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57 |
| System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114 |
| System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31 |
| System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142 |
| Telerik.Web.UI.GridTableView.PerformSelect() +28 |
| System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 |
| Telerik.Web.UI.GridTableView.DataBind() +354 |
| Telerik.Web.UI.RadGrid.DataBind() +165 |
| Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +3855 |
| Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) +175 |
| System.Web.UI.Control.LoadRecursive() +50 |
| System.Web.UI.Control.LoadRecursive() +141 |
| System.Web.UI.Control.LoadRecursive() +141 |
| System.Web.UI.Control.LoadRecursive() +141 |
| System.Web.UI.Control.LoadRecursive() +141 |
| System.Web.UI.Control.LoadRecursive() +141 |
| System.Web.UI.Control.LoadRecursive() +141 |
| System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 |
If I can use a GridNumericColumn for the same data field without a problem, but the presence of this particular column in a calculation is objectionable.
Here is an extract of the RadGrid declaration:
| <telerik:RadGrid ID="rgrdReport" runat="server" GridLines="Vertical" Skin="Office2007" |
| AutoGenerateColumns="False" PageSize="25" EnableLinqExpressions="false"> |
| <MasterTableView CommandItemSettings-ShowExportToWordButton="True" CommandItemSettings-ShowExportToPdfButton="True" |
| CommandItemSettings-ShowExportToExcelButton="True"> |
| <CommandItemSettings ShowExportToExcelButton="True" |
| ShowExportToPdfButton="True" ShowExportToWordButton="True" /> |
| <Columns> |
| <telerik:GridNumericColumn UniqueName="column" HeaderText="Our Quantity" DataField="our_qty" DataFormatString="{0:N}" DataType="System.Decimal"> |
| <ItemStyle Width="80px" HorizontalAlign="Right" /> |
| </telerik:GridNumericColumn> |
| <telerik:GridNumericColumn UniqueName="column1" HeaderText="Our $" DataField="our_amount" DataFormatString="{0:C}" DataType="System.Decimal"> |
| <ItemStyle Width="80px" HorizontalAlign="Right" /> |
| </telerik:GridNumericColumn> |
| <telerik:GridNumericColumn UniqueName="column2" HeaderText="Their Quantity" DataField="their_qty" DataFormatString="{0:N}" DataType="System.Decimal"> |
| <ItemStyle Width="80px" HorizontalAlign="Right" /> |
| </telerik:GridNumericColumn> |
| <telerik:GridNumericColumn UniqueName="column3" HeaderText="Their $" DataField="their_amount" DataFormatString="{0:C}" DataType="System.Decimal"> |
| <ItemStyle Width="80px" HorizontalAlign="Right" /> |
| </telerik:GridNumericColumn> |
| <telerik:GridCalculatedColumn UniqueName="column4" HeaderText="Quantity Variance" DataFields="our_qty, their_qty" Expression="{1}-{0}"> |
| <ItemStyle Width="80px" HorizontalAlign="Right" /> |
| </telerik:GridCalculatedColumn> |
| <telerik:GridCalculatedColumn UniqueName="column5" HeaderText="$ Variance" DataFields="our_amount, their_amount" Expression="{1}-{0}"> |
| <ItemStyle Width="80px" HorizontalAlign="Right" /> |
| </telerik:GridCalculatedColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings AllowDragToGroup="False"> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
Remove "column4" and the grid displays fine. How can [their_qty] be ok in column2 but not column4?
This is the second error I received with this grid, but a search of the forum and adding EnableLinqExpressions="false" to the defenition fixed the earlier error "DataBinding: 'System.Data.Common.DataRecordInternal' does not contain a property with the name 'column4Result'."
Thanks.