Hi all,
In a hierarchical xamdatagrid, there is an expand button (+) in front of the parent row. When the parent row's children list is empty, this button is still displaying after initialization. Then, when user click the button, it disappears and child headers still visible.
I tried to solve this by using this code:
ExpansionIndicatorDisplayMode="CheckOnDisplay"
and
<igWPF:XamDataGrid.FieldSettings> <igWPF:FieldSettings ExpandableFieldRecordExpansionMode="ShowExpansionIndicatorIfSiblingsExist" ExpandableFieldRecordHeaderDisplayMode="Default"/> </igWPF:XamDataGrid.FieldSettings>
Thanks for your help.
Hello,
I tested using ExpansionIndicatorDisplayMode="CheckOnDisplay" and the grid only showed expansion indictors for the rows with children as expected.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version 15.1.20151.1000 in Infragistics for WPF 2015 Volume 1.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if I can provide any further assistance.
Sincerely,
Valerie
Software Developer
Infragistics
www.infragistics.com/support
Hello Valerie,
Thanks for your answer. I'm using 13.1.20131.2406 version of Infragistics.
This is the issue I have :
the solution proposed in this form was to add the code below:
<Style TargetType="{x:Type igWPF:ExpandableFieldRecordPresenter}"> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Record.HasChildren}" Value="False">
<Setter Property="Height" Value="0"/> </DataTrigger> </Style.Triggers> </Style>
But this code throws an exception a "System.InvalidOperationException: Can't set the datasource on a DataPresenter that has items added explicitly through the DataItems collection."
I tested this style in the attached sample using Infragistics for WPF 13.1 build 2406 and the expandable field record presenters were not displayed when there were no children. I also added a style to set the expansion indicators height to zero if there are no children.
Please review my sample to determine the difference between it and your application.
In addition, as I see this post was created under a trial subscription, I would recommend that you contact our sales team to renew your support contract if you would like to continue to receive support for past volumes as trail support contracts are meant to support the latest version only.
Please let me know if you have any questions.
I finally figured out what wasn't right.
I put the 2 styles not in my usercontrol.Resources but in my datagrid.Resources and it worked.
Thank you very much for all the guidance.