Hello,
I have a question about the LoadCustomization method. Why this method doesn't make visible column that are mentionned as visible in xml customization file but have been hidden using column selector panel of XamDataGrid ?
Has anyone an answer or a workaround to make hidden column visible ?
Jean
Jean,
If I hide a column by unchecking it in the field chooser, then that column will have:
Visibility="Collapsed" and isCollapsedInLayout="true" in the customization file.
Therefore, when I load the customization file, that column collapses and is not visible, which is exactly what I was expecting.
Am I properly modeling the situation? If not, please attach a sample and/or let me know precisely how I should try to reproduce this.
Thanks,
Francis
This is not what happens.
I made a save of a default customization where all columns are visible.
One of my file :
<xamDataPresenter version="10.1.20101.1000" formatVersion="1,5"> <fieldLayouts> <fieldLayout key="MeasurePoint" fieldList="Numero;String;unbound;System.Windows.PropertyPath, Libelle;String;unbound;System.Windows.PropertyPath, Type;String;unbound;System.Windows.PropertyPath, CODNAT;String;unbound;System.Windows.PropertyPath, GET;String;unbound;System.Windows.PropertyPath, Tableau;String;unbound;System.Windows.PropertyPath, Date;DateTime;unbound;System.Windows.PropertyPath, NumPoint;String;unbound;System.Windows.PropertyPath, Valeur;String;unbound;System.Windows.PropertyPath, CH;Boolean;unbound;System.Windows.PropertyPath, CS;Boolean;unbound;System.Windows.PropertyPath, PI;Boolean;unbound;System.Windows.PropertyPath, Tarif;String;unbound;System.Windows.PropertyPath"> <fields> <field name="Numero" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="0" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="Libelle" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="1" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="Type" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="2" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="CODNAT" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="3" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="GET" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="4" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="Tableau" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="5" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="Date" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="6" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="NumPoint" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="7" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="Valeur" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="8" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="CH" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="9" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="CS" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="10" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="PI" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="11" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> <field name="Tarif" cellWidthAuto="true" labelWidthAuto="true" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" row="0" column="12" rowSpan="1" columnSpan="1" isCollapsedInLayout="false" /> </fields> <recordFilters /> <summaries> <SummaryDefinition SourceFieldName="Numero" StringFormat="Nb de lignes = {0:0}" Calculator="Count" /> </summaries> </fieldLayout> </fieldLayouts></xamDataPresenter>
then User makes his customization and hide some column. Then he clicks on a button that clear his customization by loading this previous default file.
All sort and group are reset but column that was hidden by field chooser remain hidden. User must open field chooser again and make them visible.
Is this behavior normal or is there a bug ? If this is not a bug, what is way to make hidden columns visible ?
thank's for reply,
Regards,
Hi,
I tried to generate customization file with new version and then i try again my test. Result is always the same.
Maybe there is a conflict with default style or something else.
Do you have any suggestion I can test to help me ?
I tested a new version of the sample with an unbound field. I follow the same steps (except this time I remove the unbound field, instead of one of the bound fields). The unbound field is still being re-displayed when loading the layout....still the expected behavior.
The customization file looks like this in my test:
<?xml version="1.0" encoding="utf-8"?><xamDataPresenter version="10.1.20101.1000" formatVersion="1.5"> <fieldLayouts> <fieldLayout key="Employee" fieldList="UnboundField;String;unbound, EmployeeID;Int32, Salary;Double, Name, OnSite;Boolean, DateOfHire;DateTime, Department;Int32, Site"> <fields> <field name="UnboundField" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="EmployeeID" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Salary" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Name" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="OnSite" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="DateOfHire" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Department" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Site" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> </fields> <recordFilters /> </fieldLayout> </fieldLayouts></xamDataPresenter>
Does your customization file look like this when you test with MY sample? Do you see a different xml structure only with your application, or is it also different with my sample when run on your machine?
PS - I'm passing your comments from 8/31 and 9/2 to our engineers to see if anything you describe provides a possible clue to the cause.
Yes there is a difference :
For each unbound field, there is an additional markup parameter named extendedInfo. Its value seems to be the same containes in fieldList parameter of fieldLayout markup. I send to you a copy of my file
<?xml version="1.0" encoding="utf-8"?><xamDataPresenter version="10.2.20102.2001" formatVersion="1,6"> <fieldLayouts> <fieldLayout key="" fieldList="Date;DateTime;unbound;LogDate, NumComptage;String;unbound;MeterId, Libelle;String;unbound;MeterName, Type;String;unbound;MeterType, Message;String;unbound;ExtendedLabel, CodeMessage;String;unbound;Message.MessageCode, TypeMessage;String;unbound;Message.MessageType, TypeDefaut;String;unbound;CommunicationDefecType.DefectTypeLabel, Action;String;unbound;Action.ActionCode, Poste;String;unbound;Workstation.Name, Composant;String;unbound;ProcessName"> <fields> <field name="Date" extendedInfo="Date;DateTime;unbound;LogDate" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="NumComptage" extendedInfo="NumComptage;String;unbound;MeterId" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Libelle" extendedInfo="Libelle;String;unbound;MeterName" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Type" extendedInfo="Type;String;unbound;MeterType" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Message" extendedInfo="Message;String;unbound;ExtendedLabel" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="CodeMessage" extendedInfo="CodeMessage;String;unbound;Message.MessageCode" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="TypeMessage" extendedInfo="TypeMessage;String;unbound;Message.MessageType" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="TypeDefaut" extendedInfo="TypeDefaut;String;unbound;CommunicationDefecType.DefectTypeLabel" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Action" extendedInfo="Action;String;unbound;Action.ActionCode" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Poste" extendedInfo="Poste;String;unbound;Workstation.Name" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Composant" extendedInfo="Composant;String;unbound;ProcessName" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> </fields> <summaries> <SummaryDefinition SourceFieldName="Date" StringFormat="Nb de lignes = {0:0}" Calculator="Count" /> </summaries> </fieldLayout> <fieldLayout key="" fieldList="Date;DateTime;unbound;LogDate, NumComptage;String;unbound;MeterId, Libelle;String;unbound;MeterName, Type;String;unbound;MeterType, Message;String;unbound;ExtendedLabel, CodeMessage;String;unbound;Message.MessageCode, TypeMessage;String;unbound;Message.MessageType, TypeDefaut;String;unbound;CommunicationDefecType.DefectTypeLabel, Action;String;unbound;Action.ActionCode, Poste;String;unbound;Workstation.Name, Composant;String;unbound;ProcessName"> <fields> <field name="Date" extendedInfo="Date;DateTime;unbound;LogDate" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="NumComptage" extendedInfo="NumComptage;String;unbound;MeterId" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Libelle" extendedInfo="Libelle;String;unbound;MeterName" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Type" extendedInfo="Type;String;unbound;MeterType" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Message" extendedInfo="Message;String;unbound;ExtendedLabel" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="CodeMessage" extendedInfo="CodeMessage;String;unbound;Message.MessageCode" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="TypeMessage" extendedInfo="TypeMessage;String;unbound;Message.MessageType" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="TypeDefaut" extendedInfo="TypeDefaut;String;unbound;CommunicationDefecType.DefectTypeLabel" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Action" extendedInfo="Action;String;unbound;Action.ActionCode" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Poste" extendedInfo="Poste;String;unbound;Workstation.Name" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> <field name="Composant" extendedInfo="Composant;String;unbound;ProcessName" Visibility="Visible" IgnoreFieldVisibilityOverrides="false" /> </fields> <summaries> <SummaryDefinition SourceFieldName="Date" StringFormat="Nb de lignes = {0:0}" Calculator="Count" /> </summaries> </fieldLayout> </fieldLayouts></xamDataPresenter>
It appears too that filedLayouts is defined twice and I don't know why since i declare only one time filed layout in Xaml.
Is this helpful for you ?
Thank's for you're help.
I have generated again customization files with new version.
I have clean all former files, and been careful new files replaced formers.
So now columns that have been hidden become visible whan I load customization file.
I am sorry because I told you that didn't work at all, but since I wasn't able to reproduce / find solution I redid all again.
Thank's for all your help.
Good work, Jean. Thanks for following up. I'm glad you're past the issue.
SOLUTION :
Delete all former files that have been generated with a former version of Infragistics.
Generate them again.
All works fine with new files !