Hello,
I am creating using a XamDatagrid (16.2.20162.2109) that is partly created in code behind (with a dynamic number of columns). When the user starts a refresh all the underlying bindings are created again and send OnProperyChanged("nameofproperty"). The structure of the binding is complex and some bound attributes (eg. the color of the cell) are derived from a substructure inside the binding.
XamDatagrid is bound to a property Ressourcen = ObservableCollection<AERow>. Each AERow has a List<AEColumn> that presents one day. Each AEColumn has a List<AEDetails> that contain all details about one resource at one day.
In most of of he cases this works perfect. Some customers have reported that Refresh shows only a white grid and that the functions (eg. doubleclick on a cell) do not work. I could see this problem at a customer site and have looked for common aspects. It turns out that the only common aspect I could see so far are the display cards. In all cases it is an Intel onboard card. It can be HD4600, Iris HD450. The systems are running on Win7 or Win10. I have also seen a number of installations with Intel HD cards that work without troubles.
My question: Is there any known issues arround specific display cards?
Thanks
Niko
The best approach may depend on the number of updates, if there are only a few updates it would be better to update the current collection the grid is bound to. If there are many updates it may be more efficient to either bind to a new list or suspend notifications for the collection so the collection and have the collection raise a reset notification once updates are resumed. To understand what is happening, it will help when you can provide an isolated example of the issue.
Hello Alan,
there is no relation to specific graphic adapters any more - its directly related to the number of columns.
It will be not possible for me to create an isolated example in the next days or even weeks.
For that reason I would like to understand a basic question about XamDatagrid: What is the best way to refresh a XamDatagrid which is bound to an ObservableCollection<T> or List<T>:
a) recreate the underlying collection by this.bindingList = new List<T>();
b) Keep the underlying collection always alive and clear and refill it?
Niko,
Is the behavior still tied to the Intel graphics cards or is the only relevant factor the number of weeks/columns?
Is it an option to fill the List<AEColumn> before changing the instance that the Tage property points to? If yes, does that resolve the error?
If not, we may still need a sample that reproduces the issue that we can use for debugging. Would you be able to create a sample that has the same refresh logic and markup as your application? If this reproduces the behavior it will help for debugging and understanding what is happening. Even if it doesn't reproduce the behavior, having the relevant markup and code may help in coming up with a theory of what might be happening.
Let me know if you have any questions.
Hello Alan,an additional piece of information got available. It turned out that these impacted customers have something additional in common: The want to see a range of more the 10 weeks.The XamDatagrid is created in following way:1. A few colums are definined in XAML2. A parameter in the user.config sets the number of weeks the users wants to see. In code behind I create per week a column for every day. When I create more than 10 weeks = 70 columns the problem with refresh is visible.I can reproduce this problem also on my PC and also on a remote terminal server.When I perform a refresh, the List<AEColumn> in the property Tage is simply replaced with an empty list and then refilled:this.Tage = new List<AEColumn>();This fires a property changed and therefore the binding is failing.System.Windows.Data Error: 17 : Cannot get 'Item[]' value (type 'AEColumn') from 'Tage' (type 'List`1'). BindingExpression:Path=Tage[0].KompaktAE; DataItem='AERow' (HashCode=40461205); target element is 'ValueHolderWithDataContext' (HashCode=37324580); target property is 'Value' (type 'Object') ArgumentOutOfRangeException:'System.ArgumentOutOfRangeException: Das angegebene Argument liegt außerhalb des gültigen Wertebereichs.Parametername: index'During the initial activation of the view it is no problem, because the viewmodel is created before the view.I don`t understand why the exceptions are only occuring when I create more than 10 weeks and there are no exceptions with binding if there are max 10 weeks.Do you have any hints on this behavior?Niko
The best approach is still to work in an isolated sample outside of your application to see if you can reproduce the behavior. Ideally we find a sample that reproduces the issue where you can send us the sample and we can look to see if we can duplicate the environment for debugging. As far as creating a sample, I would recommend just creating a sample that targets the same architecture that contains a grid handling the same events and property change notifications so that it is likely to reproduce the behavior on the environment and test it.
If you are going to debug your actual application I would attach a debugger to the application and break on first chance exceptions and see if any are thrown. Note that this might require installing a debugger on a machine that has the issue.
It is also possible that if you are running a 32 bit application on a 64bit OS that an exception just gets swallowed and some of your code isn't executing. There are some details on this on stack overflow in VS2010 does not show unhandled exception message in a WinForms Application on a 64-bit version of Windows.
Maybe if you find exceptions happening in the application when the issue occurs it will give some hints to what is happening before trying to add more debugging output as this isn't something that is readily available.
Let us know if you have any questions with this matter.