[Column Name] is neither a DataColumn nor a DataRelation for table DefaultView

5 posts, 1 answers
  1. Avinash Tauro
    Avinash Tauro avatar
    7 posts
    Member since:
    Oct 2009

    Posted 05 Apr 2012 Link to this post

    Hi,

    I have a telerik RadGrid on a form with filters. My project is configured for .net 3.5 and everything works great including filters.

    When I deploy to the test server, all the functionality except the following works as expected.

    One of my columns which is boolean throws an exception whenever I try to filter on it.
    Suprisingly there is another boolean column in the grid which filters perfectly.

    The tags are
    TAG Working Working fine on filter is
    <telerik:GridCheckBoxColumn DataField="IsTrial" DataType="System.Boolean" FilterControlAltText="Filter IsTrial column"
    HeaderText="IsTrial" SortExpression="IsTrial" UniqueName="IsTrial"></telerik:GridCheckBoxColumn>
    TAG Failing on Filter is
    <telerik:GridCheckBoxColumn DataField="IsBilled" DataType="System.Boolean" FilterControlAltText="Filter IsBilled column" HeaderText="IsBilled" SortExpression="IsBilled" UniqueName="IsBilled" ></telerik:GridCheckBoxColumn>

    I see on the following error in the browser when I select filter "equal to" on the IsBilled column

    Server Error in '/' Application.


    IsBilled is neither a DataColumn nor a DataRelation for table DefaultView.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.ArgumentException: IsBilled is neither a DataColumn nor a DataRelation for table DefaultView.

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 

    [ArgumentException: IsBilled is neither a DataColumn nor a DataRelation for table DefaultView.]
       System.Data.DataRowView.get_Item(String property) +1742474
       lambda_method(ExecutionScope , DataRowView ) +211
       System.Linq.WhereEnumerableIterator`1.MoveNext() +161
       System.Linq.Enumerable.Count(IEnumerable`1 source) +189
       lambda_method(ExecutionScope ) +117
       System.Linq.EnumerableExecutor`1.Execute() +103
       System.Linq.EnumerableExecutor`1.ExecuteBoxed() +23
       System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +83
       Telerik.Web.UI.GridDynamicQueryable.Count(IQueryable source) +143
       Telerik.Web.UI.GridDataTableFromEnumerable.FillData35() +3353
       Telerik.Web.UI.GridDataTableFromEnumerable.FillData() +628
       Telerik.Web.UI.GridResolveEnumerable.Initialize() +32
       Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized() +20
       Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, DataView dataView, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +163
       Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +71
       Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +398
       Telerik.Web.UI.GridTableView.get_ResolvedDataSource() +158
       Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +316
       Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +545
       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() +16
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
       Telerik.Web.UI.GridTableView.DataBind() +229
       Telerik.Web.UI.GridTableView.Rebind() +48
       Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source) +524
       Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +134
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
       Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +38
       System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
       Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +87
       Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object commandArgument) +46
       Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +8017
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634
     
    ----
  2. Answer
    Eyup
    Admin
    Eyup avatar
    3825 posts

    Posted 10 Apr 2012 Link to this post

    Hi Avinash,

    Thank you for contacting us.

    This erratic behavior is due to the fact that your isBilled column cannot access its required DataField. Please check your DataSource configuration closely and see if this DataField's exact name is "isBilled".

    I hope this helps. I am awaiting your reply.

    Greetings,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. swapnil
    swapnil avatar
    1 posts
    Member since:
    Apr 2015

    Posted 17 Apr 2015 in reply to Eyup Link to this post

    Hi Avinsah

      I also got this error while filtering the data ..... It not shows always but it comes after some time, while exporting and filtering .... I checked that my DataField name is same as column name and data is binding correctly , but I dont know why this error is coming

  4. Eyup
    Admin
    Eyup avatar
    3825 posts

    Posted 22 Apr 2015 Link to this post

    Hello Swapnil,

    Is the problem column specific? Does it appear with other columns as well? You can run some test with the configuration from the live filtering samples:
    http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/basic-filtering/defaultcs.aspx

    If the problem remains, you can open a formal support ticket and provide further details there.

    Regards,
    Eyup
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  5. Eric D. Burdo
    Eric D. Burdo avatar
    5 posts
    Member since:
    Sep 2011

    Posted 14 Feb 2018 in reply to Eyup Link to this post

    I recently had this issue.  In my instance, the stored procedure behind the grid was missing the [Column Name].  I had inadvertently removed it.

    As soon as I put it back into the proc, it worked fine.

Back to Top