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

A column named 'CAT' already belongs to this DataTable

1 Answer 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
qxuRad
Top achievements
Rank 1
qxuRad asked on 27 Oct 2008, 08:25 PM
Hi,
      I am using ASP.NET AJAX RadGrid 2008.2.826.20. 
    
     I dynmaically create the Grid and GroupByExpressions, and it works fine.

     But as long as I set the aggregate of the GroupByExpression SelectField,  like (grpSelFld.Aggregate = GridAggregateFunction.Count),  Or  set the group sub totoal,  then I got an error below. 
      
      Please help to resolve this issue.  Thanks!
     
         A column named 'CAT' already belongs to this DataTable

    Stack Trace:

[DuplicateNameException: A column named 'CAT' already belongs to this DataTable.]
   System.Data.DataColumnCollection.RegisterColumnName(String name, DataColumn column, DataTable table) +2020769
   System.Data.DataColumnCollection.BaseAdd(DataColumn column) +79
   System.Data.DataColumnCollection.AddAt(Int32 index, DataColumn column) +74
   System.Data.DataColumnCollection.Add(String columnName, Type type) +48
   Telerik.Web.UI.GridDataSetHelper.CreateGroupByTable(DataTable SourceTable, GridTableView view) +304
   Telerik.Web.UI.GridEnumerableFromDataView.PerformTransformation() +3605
   Telerik.Web.UI.GridEnumerableFromDataView.TransformEnumerable() +18
   Telerik.Web.UI.GridTableView.GetEnumerator(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ArrayList dataKeysArray) +105
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +181
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +539
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
   Telerik.Web.UI.GridTableView.PerformSelect() +4
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
   Telerik.Web.UI.GridTableView.DataBind() +304
   Telerik.Web.UI.RadGrid.DataBind() +77
   Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +2323
   Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) +120
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 29 Oct 2008, 10:33 AM
Hello qxuRad,

This looks like a databinding issue.
However, in order to further investigate the case, please open a formal support ticket, and send us the problematic code, for additional debugging.

Regards,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
qxuRad
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or