Hi,
when i set as DataSource an empty collection (ObservableCollection) the header of the datagrid. disappers.
It's possible to set a property (?) that leave the header when the collection is empty?
Thks for help...
Hello,
What is the exact version of our controls that you are using. I cannot reproduce this when testing this with the latest service release for 9.2 :
xamDataGrid1.DataSource = new ObservableCollection<Person>();
Probably I've unterstood the problem.
We have a hierarchy of class.ABusinessObjectEntity (Abstract class) and the really implementation (for example PersonEntity).
When I set the data source to a XamDataGrid I use:
new ObservableCollection<ABusinessObjectEntity> and then I add PersonEntity objects.So when the collection is empty the header disappers.
There is a workaround to leave the header visible? If I add an empty PersonEntity object the header is visible.
Thks for the help.
You are right. It is because of the Abstract class. It does not work with interfaces as well. I am guessing that is because they cannot have constructors.
Actually I have mislead you. It is working correctly. What the XamDataGrid does is getting the public properties of the class. It does not matter if you have or not a constructors in order for the fields to be generated. Does your abstract class has public properties?
If I comment the code:
//datagrid.FieldSettings.SummaryDisplayArea = SummaryDisplayAreas.BottomFixed;
The header don't disappears.
It's normal?
I am also very interested in this issue. It is particularly problematic in the case of FilterUIType="LabelIcons" -- in this case a filter that results in an empty collection causes the header to disappear, and with it, the filter control. Then there is no way for the user to change the filter and get the table back. Aside from that problem, displaying a big empty panel when there are no objects is poor feedback for the user. This problem also creates a serious architecture problem for me. I really need to use business objects rather than a DataView.
I have noted some additional behaviors that may be useful for you in tracking the problem down. Specifically, the problem (i.e. header disappearance on an empty collection) doesn't seem to occur when a summary [aggregation] function has been set -- i.e. if I have a "count" function selected for a column, then the header line (along with the summary area) stays visible even when a filter causes the collection to appear empty.
Is there a workaround for this issue? I noted Sacha's test case makes use of C# [rather than XAML] for setting up most of the XamDataGrid's attributes, and, in particular, the non-problem case required the commenting-out of C# code. Short of a major re-write to replace most of my XAML code with C#, I'm not sure what to try next. (I have tried adding SummaryDisplayArea="Bottom" and other similar things to the XAML, but to no avail.)
Is this issue related to the discussion at the following URL?
http://community.infragistics.com/forums/p/10948/127789.aspx
In that thread, a workaround is suggested by rkcarlin, but I cannot seem to make it work. (Some of the details are unclear in the description of the workaround, so I may be missing something.)
Is there a bug tracking number for this issue? I noticed there was a service release that just went out, but I assume there wasn't time to get this issue addressed, and I assume it'll be a while until the next service release. (Am I right?)
Thks for the answer.
Sacha
Sorry for the late response. This looks like an issue. I was able to reproduce this in an isolated scenario. You will be notified when this is resolved and the service release for it is out.
I attach a Solution to reproduce the problem.
In the constructor there are three methods to reproduce the problem.
Datagrid 1) loadDataWithHeader() Is the normal case with data and header visible.
Datagrid 2) loadDataWithoutHeaderAndNoData() Is the case without data and without header
Datagrid 3) loadDataWithHeaderAndNoDataAndSummaryPositionCommented() Is the case that header are visible but without data. The difference beetween the method 2 is that the line code is commented //xamDataGrid1.FieldSettings.SummaryDisplayArea = SummaryDisplayAreas.BottomFixed;
The property are the same for the 3 datagrid except the line commented for datagrid 3.
I hope you understand the example.
Can you provide a sample project demonstrating this?