Hi,
I have bound XamDataGrid to a hierarchical data source and only want one column header for the root records, all expanded child table's column header is hidden, how can I achieve this? Thanks.
Did you ever find a solution to this? We have the exact same problem.
The solution we eventually reached was instead of using the child table capability in our scenario, we manually insert/remove records in the underlying data source to mimic expand/collapse behavior.
It says "synchronization is not a built – in functionality" - so you want me to pile further workarounds on top? Nope, thanks. I want something that works relibably and doesn't require constant attention, bugfixing and more workarounds. Especially for such a simple feature...
I still don't have a properly working solution for this :(
Is 900 USD/y not enough for you to provide a solution? Do we need to pay more? We need this to work!
Hello Stefan,
Attached solution does not work if I set FieldLayoutSettings' AutoGenerateFields to 'false'.
If I make make AUtogenerate = 'false' then I am unable to generate tree deeper than 2 levels that is only one child is shown for each parent.
Please help. It is urgent.
Thanks,
Priya
Hello Priya,
I have been looking into your post, but it seems like that I am missing something in your scenario, so if this is still an issue for you, could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
Looking forward for your reply.
Sorry for late reply but I had to work on some other project for a while.
I tried the solution you provided but it still has some proble. Now, it generates all the data as expected but it shifts column layout for child records.
I tried to change MainWindow_PropertyChanged method to make it work with no luck. Is there any workaround for this.
Inserted image of the screenshot for your reference.
.
Or the simpler version of this feature: http://ideas.infragistics.com/forums/192363-wpf/suggestions/5589141-xamdatagrid-hide-child-table-field-headers
I can say that the approach used in this sample is meant to work with AutoGenerateFields set to true. If you want to hide some of the Fields you can handle the XamDataGrid's FieldLayoutsInitialized method and hide the Fields you don't want to visualize. I modified the sample to show you this approach. Also I can suggest you vote for this idea, so this functionality can be implemented in our future versions:
http://ideas.infragistics.com/forums/192363-wpf/suggestions/5988260-new-wpf-tree-grid-control
Please let me know if this helps you or you have further questions on this matter.
Thank you for your reply.
I tried your solution in TreeView_SelfReference.zip folder. It generates tree view as required but it does not align second column of XamDataGrid for both parent-child columns when loaded for first time.
If you change the column alignment manually to align then it works perfect afterwards.
What should I change to have even alignment on loading. Your solution is working just fine in that case as well.
In the sample I attached to my last response ("TreeView_SelfReference_Modified.zip") the AutoGenerateFields Proeprty is set to false and there are no child labels. Please note that there are two Styles defined for the LabelPresenter and DataRecordPresenter and their Loaded events are handled. In the handlers the columns are synced and the child headers are hidden. Please let me know if you have further questions on this matter.