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!
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.
Hi Martin,
To prevent column generation for a property in a lookup list view, use the VisibleInLookupListView(false) attribute. Please modify your code as follows:
[VisibleInListView(false), VisibleInLookupListView(false)] public string DocumentName { get { return this.GetDocumentName(); } }
However, the current version incorrectly processes this attribute. We've fixed this bug. The fix will be available in the next maintenance update.
Thanks,
Michael.
Michael,
to problem is that you set an sortorder for an nonpersistent property - and this causes exceptions if the view is in servermode. i dont want / i cannot remove the column from my listview !?
Hi Martin,
This issue is not related to sorting, but to the fact that you are displaying a non-persistent property in a server-mode list view. Non-persistent properties are not supported in server mode. You should remove the corresponding column, or define the property as a PersistentAlias, if possible.
I've created a separate report about the VisibleInLookupListView attribute - Application Model - VisibleInLookupListViewAttribute is not considered while generating a lookup List View.
Thanks,
Michael.
Hi Michael,
i know that there are limitations for nonpersistent properties in servermode, but when you say they are not supported, i hear that the first time. i can show nonpersistent properties in an servermode view - there are no problems with them, grouping and sorting is disabled for such properties by the grid. but the framework is setting automaticly an option in the model which leads to exceptions - thats not correct guys!
Hi Martin,
Thank you for the response. Indeed, the problem is related to a default sorting applied to a non-persistent column. We'll research this issue further, and try to fix it as soon as possible.
Thanks,
Michael.
Hi Martin,
We can't change model generation, based on the current view mode. Besides, if you modify the model by enabling the server mode, this will also lead to an exception. We've fixed this issue by removing sorting applied to a non-persistent property while applying the model to the grid control.
Thanks,
Michael.
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!
You're welcome, Martin.
See Also:
UI - Disable server side operations (sorting, filtering, grouping, field chooser in the filter control, etc.) or provide warnings for non-persistent properties by default