Hi, I have a grid that binds to a data table. Data table can have different number of columns. A user can select the view (grouping or not and if to show a data table A or B).
Everything works ok when there is no grouping.
When I add grouping: if a grid is bound to a data table with less columns (than the currently bound one) all works ok, but if a new data table has more columns I get an error that "Column 'Col 4' does not belong to table .
I am assuming that I do something wrong but so far could not see what it is. Could somebody point me in the right direction? The issue is: a grid is bound dynamically to differently structured data tables and when there is grouping added ... swicthing to a table with more columns causes and error (Error only occurs when there is grouping and aggregate function in a footer).
I can supply a simple project that demonstartates this if this is not somethign obvious.The grid is RADGrid for ASP.NET AJAX and the version is 2009 Q1
Full Error:
-----------------------------------------------------------------------------------------------------------------------------
ArgumentException: Column 'Col 4' does not belong to table .]
System.Data.DataRow.GetDataColumn(String columnName) +1775301
System.Data.DataRow.get_Item(String columnName) +13
Telerik.Web.UI.GridDataSetHelper.CalculateAggregates(DataRow SourceRow, DataRow DestRow, Int32 rowCountInGroup, GridTableView view) +704
Telerik.Web.UI.GridDataSetHelper.InsertGroupByInto(GridTableView gridTableView, DataTable DestTable, DataTable SourceTable, String RowFilter, Int32 FirstIndexInPage, Int32 LastIndexInPage, Boolean ApplyPaging, Boolean IsCustomPaging) +669
Telerik.Web.UI.GridEnumerableFromDataView.PerformTransformation() +2743
Telerik.Web.UI.GridEnumerableFromDataView.TransformEnumerable() +21
Telerik.Web.UI.GridTableView.GetEnumerator(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ArrayList dataKeysArray) +105
Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +169
Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +499
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() +4
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
Telerik.Web.UI.GridTableView.DataBind() +238
Telerik.Web.UI.RadGrid.DataBind() +80
Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +2122
Telerik.Web.UI.RadGrid.Rebind() +9
TelerikGridApp._Default.ddl_indexChanged(Object sender, EventArgs e) in C:\Projects\NRS\Utils\TelerikGridApp\Default.aspx.cs:68
System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +111
System.Web.UI.WebControls.DropDownList.RaisePostDataChangedEvent() +134
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +10
System.Web.UI.Page.RaiseChangedEvents() +165
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485
Thanks,
KJRB
Everything works ok when there is no grouping.
When I add grouping: if a grid is bound to a data table with less columns (than the currently bound one) all works ok, but if a new data table has more columns I get an error that "Column 'Col 4' does not belong to table .
I am assuming that I do something wrong but so far could not see what it is. Could somebody point me in the right direction? The issue is: a grid is bound dynamically to differently structured data tables and when there is grouping added ... swicthing to a table with more columns causes and error (Error only occurs when there is grouping and aggregate function in a footer).
I can supply a simple project that demonstartates this if this is not somethign obvious.The grid is RADGrid for ASP.NET AJAX and the version is 2009 Q1
Full Error:
-----------------------------------------------------------------------------------------------------------------------------
ArgumentException: Column 'Col 4' does not belong to table .]
System.Data.DataRow.GetDataColumn(String columnName) +1775301
System.Data.DataRow.get_Item(String columnName) +13
Telerik.Web.UI.GridDataSetHelper.CalculateAggregates(DataRow SourceRow, DataRow DestRow, Int32 rowCountInGroup, GridTableView view) +704
Telerik.Web.UI.GridDataSetHelper.InsertGroupByInto(GridTableView gridTableView, DataTable DestTable, DataTable SourceTable, String RowFilter, Int32 FirstIndexInPage, Int32 LastIndexInPage, Boolean ApplyPaging, Boolean IsCustomPaging) +669
Telerik.Web.UI.GridEnumerableFromDataView.PerformTransformation() +2743
Telerik.Web.UI.GridEnumerableFromDataView.TransformEnumerable() +21
Telerik.Web.UI.GridTableView.GetEnumerator(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ArrayList dataKeysArray) +105
Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +169
Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +499
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() +4
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
Telerik.Web.UI.GridTableView.DataBind() +238
Telerik.Web.UI.RadGrid.DataBind() +80
Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +2122
Telerik.Web.UI.RadGrid.Rebind() +9
TelerikGridApp._Default.ddl_indexChanged(Object sender, EventArgs e) in C:\Projects\NRS\Utils\TelerikGridApp\Default.aspx.cs:68
System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +111
System.Web.UI.WebControls.DropDownList.RaisePostDataChangedEvent() +134
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +10
System.Web.UI.Page.RaiseChangedEvents() +165
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485
Thanks,
KJRB