Ticket T266763
Visible to All Users

ASPxGridView - The " 'DevExpress.Web.Data.WebDataRow' does not contain a property with the name 'X' " exception is thrown in certain cases

created 10 years ago

Client keeps getting random exceptions:

C#
System.Web.HttpException: DataBinding: 'DevExpress.Web.Data.WebDataRow' does not contain a property with the name 'INPROFILSysRef'. Generated: Tue, 14 Jul 2015 11:11:02 GMT System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Web.HttpException: DataBinding: 'DevExpress.Web.Data.WebDataRow' does not contain a property with the name 'INPROFILSysRef'. at System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) at System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) at ASP.shoptoshoptransfers_createshoptoshoptransfer_aspx.__DataBinding__control17(Object sender, EventArgs e) at DevExpress.Web.Internal.DataHelper.PerformSelect() at DevExpress.Web.Internal.DataContainer.PerformSelect() at DevExpress.Web.ASPxDataWebControlBase.DataBindInternal() at DevExpress.Web.ASPxWebControl.DataBind() at DevExpress.Web.ASPxComboBox.DataBind() at System.Web.UI.Control.DataBindChildren() at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at DevExpress.Web.GridViewBaseTemplateContainer.DataBind() at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) at DevExpress.Web.ASPxWebControl.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control. PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

… And I'm not too sure why it does this.

The Column:

ASPx
<dx:GridViewDataTextColumn Caption="Product" FieldName="INPROFILDescription" > <EditItemTemplate> <dx:ASPxComboBox ID="cbProduct" runat="server" EnableCallbackMode="true" CallbackPageSize="10" KeyFieldName="SYSREF" OnInit="ddlProduct_OnInit" SelectionMode="Single" ValueType="System.Decimal" ValueField="SYSREF" OnItemsRequestedByFilterCondition="ASPxComboBox1_OnItemsRequestedByFilterCondition" OnItemRequestedByValue="ASPxComboBox1_OnItemRequestedByValue" Value='<%# Bind("INPROFILSysRef") %>' IncrementalFilteringMode="Contains" Width="100%" DropDownWidth="800" TextFormatString="{0} - {1} ({2})" DropDownStyle="DropDownList"> <ClientSideEvents EndCallback=" function(s, e) { if (s.GetItemCount() == 1) { s.SetValue(s.GetItem(0).value); s.HideDropDown(); } }" KeyDown="function(s, e) { e = window.event; if (e.which == 17 || e.which == 74 || e.keyCode == 13) { e.preventDefault(); } }"/> <Columns> <dx:ListBoxColumn FieldName="SYSREF" Visible="False" /> <dx:ListBoxColumn FieldName="CODE" Caption="Code" Width="100" /> <dx:ListBoxColumn FieldName="DESC1" Caption="Description" Width="200"/> <dx:ListBoxColumn FieldName="BARCODES" Caption="Barcode" Width="350"/> </Columns> </dx:ASPxComboBox> </EditItemTemplate> </dx:GridViewDataTextColumn>
Show previous comments (4)
C C
Christopher Calleja Urry 10 years ago

    Will do. Thank you.

    C C
    Christopher Calleja Urry 10 years ago

      Seems to be ok. No other reports of this happening.

      Artem (DevExpress Support) 10 years ago

        It's great to hear that the issue has been resolved. Should you have further questions, feel free to contact us.

        Answers approved by DevExpress Support

        created 10 years ago

        [DevExpress Support Team: this Answer was created based on the Owner's comment]

        The issue occurs if the ASPxGridView is bound at runtime. I see that you're using ASPxComboBox with server-side events. It may force building ASPxGridView hierarchy earlier than the DataSource property is assigned (ASPxGridView isn't bound yet). Please make sure that the DataSource property is defined on each round trip to the server either in the Page.Init event handler or in the ASPxGridView.DataBinding event handler (see Why might paging (sorting, grouping, filtering) not work in the ASPxGridView?).

          Show previous comments (5)
          Nastya (DevExpress Support) 10 years ago

            Hello Christopher,
            The initial problem was that the exception occurred randomly. Now you are writing that the "INUOMSysRef" value is null in the RowValidating / RowUpdating events. Would you please describe the problem in detail? Is this a new issue or the same one?
            As I mentioned earlier, the provided code and markup are insufficient for me to detect the cause of the problem. Please send me a working project, which I can test on my side and help you find a solution. Your cooperation is appreciated.
            I'm looking forward to your reply

            C C
            Christopher Calleja Urry 10 years ago

              The null only happens after I implement the change I could understand from the article you linked. (i.e Moving the Binding to the OnInit method)
              Without it, (as in production) I randomly get 1-2 exception reports randomly a week. For example, this week, I haven't - but most likely either luck or page hasn't been used much.
              Even if I create a random project, I've never been able to replicate this on my own computer - so I'm not sure how much help that would serve.

              Nastya (DevExpress Support) 10 years ago

                The code snippet seemed to be fine, so I need to debug the code in order to understand the cause of the problem. The information I have currently is inadequate to provide you with a precise answer. You can send me a simplified runnable version of your project where the issue with binding the lookup is reproduced.
                We guarantee that no part of your project will be disclosed, and all your files will be deleted from our disks when the conversion is successfully completed.
                If you wish to sign an NDA with our company, please contact our CTO, Julian Bucknall (mailto:julianb@devexpress.com).)

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.