Search This Blog

Showing posts with label ListView. Show all posts
Showing posts with label ListView. Show all posts

Friday, May 25, 2018

Web - How to avoid issues with data-bound controls due to missing or non-unique key values

Check out the Web - How to avoid issues with data-bound controls due to missing or non-unique key values KB article to make sure that your business model is aligned with the best practices. Here is a short extract:


Symptoms
You may notice the following side-effects in a Web ListView while it may work fine in WinForms:
- A wrong DetailView may be selected when an unsaved record is clicked in ListView;
- ListView may have no selection column;
- In inline edit or batch mode, all records may become selected or editable.
These effects are especially frequent in a non-persistent class ListView or a nested ListView for an aggregated details collection with newly added or unsaved records.

Explanation
All new records added to the ListView and not yet saved to the database will be assigned with a temporary key value (e.g. -1 or an empty Guid/String value depending on your key type). In a Web application, ListView uses a business class key property to identify records, because there is no way to access real business objects from the web browser. Hence, there is a requirement that each business object must have a unique value assigned to the key property. ASPxGridView and other data-bound controls require this for the correct operation of such features like selection, filtering, sorting, grouping and the standard XAF functionality that depends on them (see also ASPxGridBase > KeyFieldName). 
If a key property is missing in a business class completely or if a key property is not initialized with a unique value immediately after the record is created, these duplicate or invalid records may lead to a data-bound control malfunction as expected.


Please inform me of your health-check results!

FreeImages.Com

Thursday, February 8, 2018

Minor improvements to the ConditionalAppearance and ViewVariants modules - XAF v17.2.6


I also wanted to inform you of some "home work" done by us in v17.2.6 to improve your XAF development experience with these modules:

GridListEditor - An appearance rule has no effect in the new item row until a value is entered into any cell
View Variants Module - ListView variant always takes the DataAccessMode value from the root node instead of own model differences, which may cause an exception due to an incompatible ListEditor type

FreeImages.com/linusb4



While the first scenario is quite specific (we heard about it from our largest XAF customer and a few others), the second one was likely encountered if you use the ViewVariants module. For instance, when having one variant as a grid operating in server mode while having another variant as tree, pivot, scheduler or whatever ListView editor that does not support server mode. In the past, this unsupported configuration could cause an exception at runtime. Starting with v17.2.6, it all works as the majority our users expect - at least we believe so based on the feedback we received. The online documentation on the ViewVariants module will be updated accordingly by release time, of course. Finally, many thanks to Dave Hesketh, Martin Praxmarer, our MVPs, as well as other customers for bringing this to our attention.

If you cannot wait for the next maintenance update (v17.2.6) to test both things, install this night buildDevExpressNETComponents-17.2.exe


As always, my team and I are looking forward to hearing what you think, even on such small things and maybe others that could make your life a bit easier.

Wednesday, December 6, 2017

Accessing real persistent objects through the SelectedObjects and CurrentObject properties of View and Action's event arguments when DataAccessMode = DataView or InstantFeedback

The View.CurrentObject and View.SelectedObjects properties return XafDataViewRecord objects instead of original business objects when the View operates in DataView mode (and XafInstantFeedbackRecord - in InstantFeedback mode). To get a real object, you can use the View.ObjectSpace.GetObject(obj) method.

I just wanted to remind you of this specificity and detail currently recommended solution strategies:


According to our current figures for support traffic in this regard (for one year of the InstantFeedback mode existence and more than two years of the DataView mode existence), this is not a big deal for our users - I located less than seven support requests in total. Probably, this is due to the fact that our learning materials already describe this or due to the fact that the DataView and InstantFeedback modes are used rarely, only when ListView contains a lot of records. Here I must also emphasize that this behavior exists in the first place because returning real objects by default may prevent you from getting all the benefits of these data access modes... So, we implemented the current design on purpose.

Should you have difficulties with these features and aforementioned solutions or can foresee better options, my team and I are happy to listen. For instance, one of the alternative solutions I saw in a couple places was the implementation of the auxiliary GetRealSelectedObjects/GetRealCurrentObject methods.

FreeImages.com/Gordon Fortune

Monday, November 6, 2017

ASPxGridListEditor - How to customize the column chooser of the Web ListView's grid control

I wanted to promote the article that shows how to  increase the ASPxGridView's customization window size, because last week there were two requests for this + I searched around a dozen tickets in both XAF and ASPxGridView knowledge bases on the same subject. 



Previously, it was possible for developers to hard code the required width and height for this window.
Around v17.1, the ASPxGridView team created the AllowResize option (based on feedback from XAF users mostly) so that end-users could resize this dialog as they wish at runtime.

Currently, the AllowResize option is set to False by default, because the ASPxGridView team is afraid of breaking existing customer projects.

EDIT: The ASPxGridView has implemented AllowResize = True in v17.2 RTM by default.

I am looking forward to hearing from you on whether you or your end-users ever had problems with this so that our both teams can take this into account regarding future product updates. Thanks.

Friday, September 1, 2017

Focusing the newly added grid column in the Column Chooser dialog of the WinForms GridListEditor

Has anybody noticed this small improvement in XAF v17.1.5 (added as per this customer request)?
If not, check out this video to see what I am referring to:



Hopefully, this will help eliminate extra time when scrolling and searching for your end-users, especially if there are many-many columns.


We've not yet enabled this by default in DetailView and look forward to hearing your thoughts on this.

Monday, June 26, 2017

AuditTrail - How to show the change history for the current object in a separate form instead of a nested ListView

I wanted to draw your attention to the scenario and solution in our Support Center, which were found helpful by at least 4 other XAF customers using XPO for data access. As you know, by default, we offer our users a solution based on the nested ListView, which is automatically generated when you declare a collection property like this one:

    public XPCollection<AuditDataItemPersistent> AuditTrail {
        get {
            if(auditTrail == null) {
               auditTrail = AuditedObjectWeakReference.GetAuditTrail(Session, this);
            }
            return auditTrail;
        }
    }


The solution I am promoting allows you to keep the layout less complex and invoke this rarely used or quite advanced feature from a small PopupWindowShowAction showing a ListView:


It will be interesting to hear about your preferences in this regard. Please let me know in comments. Thanks!


Wednesday, May 31, 2017

XAF ASP.NET WebForms - Beware of the FormatException (Input string was not in a correct format) when clicking a record in a popup ListView

I want to draw your attention to the T514321: ASPxGridListEditor - FormatException is thrown when selecting an object in a lookup ListView shown from an aggregated collection issue, which is already fixed in XAF for v16.2.7/17.1.4

If you came across a similar issue (check the call stack), the highlighted thread contains the hotfix installation for v17.1.


Tip:
When you experienced an exception in DevExpress code, I recommend you locate its callstack and search for one or several topmost method names in our support database, because this behavior might be reported by someone else: https://search.devexpress.com/?q=ASPxGridViewContextMenu.SelectObject&m=SupportCenter


In addition, I recommend checking the Known Issues sections in our What's New documentation:

Tuesday, May 30, 2017

How to hide the New Action from the main menu, but still have it available inline as the New Item Row feature of ListEditor

I would like to promote a Support Center article on the subject, which I heavily updated with new code examples and implementation considerations after receiving a similar customer request yesterday.
As I found later when searching our support database, many users wanted this specific customization in nested ListViews, mainly not to overload end-users with a separate root DetailView in this inner context. I must say that I saw similar reasoning for MasterDetailMode = ListViewAndDetailView too (for this scenario, we offered a solution like this one).


I personally prefer the 2nd solution from this article, but I must admit that both solutions could be simpler, ideally. Please let our team know if you experienced a similar need and clarify exactly where and why as well as how you are solving it now. With that, we will be a better position to consider further improvements. Thanks in advance, guys!


Tuesday, May 23, 2017

Web - How to preserve the FullTextSearch Action filter after opening details for a record and returning back to ListView

I want to repost an interesting ASP.NET WebForms scenario and a solution for it I provided to a customer yesterday. Watch this video to see how this works:



If you are interested in having something like this, check out this Support Center thread for a relatively simple Controller.

Friday, March 10, 2017

XAF ASP.NET WebForms v16.2.5 - Beware of the missing Edit Action after navigating to dashboard items


I want to draw your attention to the T490025: WebEditDashboardController hides the Edit Action of ListViewController and doesn't reactivate it issue, which is already fixed in XAF for v16.2.6. This thread contains a simple temporary solution if you came across a similar use scenario (hotfix installation will be available later).



Tuesday, May 24, 2016

WinForms GridListEditor - How to restore values in the auto filter row

I wanted to inform you of a recent solution update for this task, which will help you restore auto filter row values for reference properties as well (previously, there might be an exception). The main change is in wrapping the GridView.GuessAutoFilterRowValuesFromFilter call into the using(var criteriaScope = View.ObjectSpace.CreateParseCriteriaScope()) {...} construction, which relies on the smart DevExpress.Data.Filtering > CriteriaOperator > UserValueParse event  handling inside our XPO/EF core libraries

using System;
using DevExpress.XtraGrid;
using DevExpress.ExpressApp;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.ExpressApp.Win.Editors;

namespace MainDemo.Module.Win {
    public class B152594 : ViewController<ListView> {
        GridListEditor gridlistEditor = null;
        protected override void OnViewControlsCreated() {
            base.OnViewControlsCreated();
            gridlistEditor = View.Editor as GridListEditor;
            if(gridlistEditor != null) {
                gridlistEditor.Grid.HandleCreated += Grid_HandleCreated;
            }
        }
        private void Grid_HandleCreated(object sender, EventArgs args) {
            GridControl grid = (GridControl)sender;
            grid.HandleCreated -= Grid_HandleCreated;
            using(var criteriaScope = View.ObjectSpace.CreateParseCriteriaScope()) {//!!!
                ((GridView)grid.MainView).GuessAutoFilterRowValuesFromFilter();
            }
        }
    }
}

After you modify the filter either by manually typing values in the topmost grid row or visually via the filter builder and reopen the form, there will be the following result in the UI:


I think your end-users will appreciate this functionality and I would be grateful to hear from you on how this works in your apps and whether there are any uncovered scenarios. Thanks! 

Friday, May 13, 2016

Usability improvements to the Object Model dialog in WinForms UI

This dialog is typically invoked from the Column Chooser in ListView or the layout customization form in DetailView.

Starting with v15.2.10, we have added the OK button, renamed the Close button to Cancel, and enabled multi-selection in the tree list within the Object Model dialog.

The Add button adds columns but does not close the dialog. You can also double-click an item to add it.
The OK button applies changes and closes the dialog. 
The Cancel button closes the dialog and does not apply changes. 

I hope your end-users find this minor thing useful.

Thursday, April 14, 2016

Improving usability with regard to the ImmediatePostData functionality in GridListEditor (WinForms)

As you perfectly know from my recent posts:-), one of our team OKRs was and still is "improving developer experience when accomplishing common tasks". In this blog post, I am going to cover one more small, but important improvement in XAF v15.2.10+ that adds to this larger goal:


In short, the previous custom-tailored solution is no longer required, as the corresponding code has been moved to the standard delivery. You can see the result in this short video.


Not to cause breaking changes a minor 15.2 version, you can activate this behavior in an editable GridListEditor via the static ImmediatePostDataSupportEnabled option. 
...
namespace MainDemo.Win {
    public class Program {
        [STAThread]
        public static void Main(string[] arguments) {
 DevExpress.ExpressApp.Win.Editors.GridListEditor.ImmediatePostDataSupportEnabled = true;
...
The ImmediatePostDataSupportEnabled option has its default value set to True by default in v16.1.

Monday, April 11, 2016

Experimental support of DataView mode in Pivot Grid List Editors in v15.2.9 - YOUR FEEDBACK IS NEEDED

There is other performance related news today. This time it is for users who need to analyze and visualize large amounts of data using the pivot table. 


Starting with v15.2.9, we have made improvements to our Pivot Grid List Editors and are ready to share a preview of our work. So far, things are pretty stable, and we have not found any issues in scenarios with DataView (a few XAF customers tested this functionality earlier did not experience problems either). We still wanted to collect more feedback and hear from you about how this works in your real projects. The more scenarios we cover at this stage, the better for the product. If all goes according to plan, this functionality will be officially released in the upcoming 16.1 build, which should be out around early June.

Monday, December 21, 2015

JFYI - New RefreshXXX methods allowing to reload the underlying data source of a View or ViewItem

Just wanted to make sure you are aware of this small usability improvement, which will help you accomplish daily development tasks easier and in more intuitively.

From https://www.devexpress.com/Support/Center/Question/Details/S170756 (done in v15.2.4):

The following methods are added to the View and ViewItem classes:[C#]
public virtual void RefreshDataSource()
public void Refresh(bool refreshDataSource)
Internally, the Refresh method calls RefreshDataSource when the refreshDataSource parameter is set to true.

The RefreshDataSource method overloads are:
ListView.RefreshDataSource -  calls the CollectionSourceBase.Reload method;
DetailView.RefreshDataSource  - calls the IObjectSpace.ReloadObject method and passes the DetailView.CurrentObject object to it;
ListPropertyEditor.RefreshDataSource - calls the ListView.RefreshDataSource method;
DetailPropertyEditor.RefreshDataSource - calls the DetailView.RefreshDataSource method.

Tuesday, October 27, 2015

Conditional Formatting for WinForms Tree List Editor

This is merely a follow up to my previous post:
How to enable the Conditional Formatting feature of the WinForms GridControl in the XAF GridListEditor and preserve ListView formatting settings between runs?

I want to share a similar solution for the TreeListEditor, which I coded and updated according to great customer feedback recently. You can learn more on this feature from the WinForms Controls > Controls and Libraries > Tree List > Conditional Formatting and TreeListOptionsMenu.ShowConditionalFormattingItem documentation.

Here are the steps needed to use the TreeListEditor in your XAF project:
1. In the Module Designer invoked for YourSolutionName.Module.Win/Module.xx file, add the Tree List Editor module to allow Visual Studio to automatically add required assembly references;
2. Copy and include this C# source file into YourSolutionName.Module.Win project (vb.net guys can either use this approach OR convert this code into their language using free tools).

Please track the corresponding Support Center thread to be automatically notified of any changes or other improvements in this regard.

As always, I am looking forward to hearing from you on whether you find this feature helpful for your apps.


Thursday, September 17, 2015

How to enable the Conditional Formatting feature of the WinForms GridControl in the XAF GridListEditor and preserve ListView formatting settings between runs?

In short, this feature allows your end-user to sort or group the data inside the grid AND to visualize selected cells, rows with data bars, icons and predefined or custom appearance schemes. Refer to the following XtraGrid documentation for more information on this feature: 



In general, accomplishing this task in an XAF app consists of several independent parts:
2. Integrating this solution in the GridListEditor using a ViewController  as described in the Access Grid Control Properties  help topic.
3. Serializing the grid's formatting rules information, taking into account the fact that it uses a different mechanism for storing settings, which is based on the Application Model. In XAF, it is best to extend the ListView node with a string property that will hold a serialization representation of formatting rules. Refer to the How to: Extend the Application Model  article for more details.

Wednesday, September 9, 2015

How to reset View customizations made by end-users (UPDATE)

I invite you to test an updated version of the previous E1897 solution (it is now marked as obsolete), which we are planning to include in v15.2 by default. The new solution supports both WinForms and ASP.NET apps and also works for both the root and nested Views (e.g., the ones embedded into ListPropertyEditor and DetailPropertyEditor):


Tuesday, March 24, 2015

Google Maps integration in XAF Web UI - Looking for real use-cases!

UPDATED:
We've implemented the new Web Map Module in v15.2 based on the great customer feedback we received from this post. Refer to the XAF - Web Map Module (Coming soon in v15.2) article for more details.
===
We had a few requests from our users on this subject, and some time ago we described two possible integration options (a custom ListEditor and PropertyEditor) in the T195734: How to use Google Maps in XAF ASP.NET application ticket. There is nothing special here as these approaches are already well-known from XAF documentation: Using a Custom Control that is not Integrated by Default

In addition to the implementation instructions, there was a sample project that should have helped you get all the pieces of the puzzle together. It was not complete implementation by any means (some scenarios were not implemented intentionally), but rather a demonstration of how that is possible in general with an intent for users to further extend and test this solution according to your exact business requirements and Google Maps API docs :-).

Unfortunately, there was not much interest and feedback from users on this basic implementation and, more importantly, on their business requirements, nor on the info on how the Google Maps component helps end-users do their work easier. We require this essential information in order to investigate whether or not it is possible to provide a universal and useful solution for this scenario as part of the standard framework delivery.

This blog post is one more attempt to collect this information from you, guys, I greatly appreciate your input in advance. I am also writing this because I've recently extended the original example implementation by supporting a few more things, which I think the majority would want to have by default. These are: opening geo point details in DetailView after clicking on it within a a map, the possibility to not only display a point's information in detail form, but also to edit its details when we are in the Edit mode with the help of ASPxObjectPropertyEditor. I demonstrated the latest features in the video below:


Unable to display content. Adobe Flash is required.


If you faced a requirement to use Google Maps or any other similar map control to better meet the needs of your clients, I would greatly appreciate it if you email me at dennis@devexpress.com and tell the details of your real use-cases along with the screenshots, videos and other info. 
To formalize this a bit and make it easier for you to answer (and for us to process too), see the four simple points:

Tuesday, December 23, 2014

A small usability improvement to the new visual ListView designer available in v14.2

Thanks to our great customers and their feedback in this Support Center ticket we could make our recent addition to the Model Editor yet better. Starting with version 14.2.4, it will be much more convenient to view and configure ListView with lots of columns, because now the horizontal scrollbar will be displayed in this situation. A picture is worth a thousand words:


Of course, the live preview will also respect column sizes set in the property grid for each IModelColumn object.