Bug Report B149851
Visible to All Users

Application Model - Sorting is always applied to a List View column corresponding to a non-persistent property

created 15 years ago

Hi Guys,
there is a bug in the above generator. In my class i have a nonpersistent property like:
        [VisibleInListView(false)]
        public string DocumentName
        {
            get
            {
                return this.GetDocumentName();
            }
        }
The problem now is that this column automaticly gets an SortOrder = Ascending in all LookupListViews - and so if the Lookup is in ServerMode you get an exception.(cannot query an nonpersistent property from datastore)
The wrong code is in ModelListViewColumnsNodesGenerator.GenerateLookupListViewColumns:
if(!String.IsNullOrEmpty(displayPropertyName)) {
                    IModelMember member = classInfo.FindMember(displayPropertyName);
                    if((member == null) || !IsVisibleInViewTrue(member)) {
                         IModelColumn captionColumn = AddLookupColumn(viewInfo, displayPropertyName);
                         captionColumn.Width = 340;
                         captionColumn.SortOrder = ColumnSortOrder.Ascending;
                         if(displayPropertyName.IndexOf('.') > 0) {
                              captionColumn.Caption = displayPropertyName;
                         }
                    }
               }
Here you automaticly set the sortorder which leeds to an exception is the view is in servermode!

Show previous comments (6)
M M
Martin Praxmarer - DevExpress MVP 15 years ago

    Hi Michael,
    "Besides, if you modify the model by enabling the server mode, this will also lead to an exception." -> sure - but then i know what i do(or not) ;)
    "We've fixed this issue by removing sorting applied to a non-persistent property while applying the model to the grid control." -> that makes sense - thank you!

    DevExpress Support Team 15 years ago

      You're welcome, Martin.

      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.