Hello,
I have a multilevel hierarchical XamDataGrid. I wan to Indent parent and child in only first column of every child record.
For this, I tried to apply CellValuePresenter style to first column of child record's FieldLayout with Left Margin 20.
It works fine for first child record but for second child level onwards also it applies margin 20 to first field.
Whereas for second child now left margin should be 40 and third level child should have left margin of 60 and so on.
I thought of achieving this by applying cellvaluepresenter to every field layout from code behind by multiplying left margin by nesting depth of current record or by adding 20 to parent record's margin. Is this possible?
How do I achieve this? or is there any work around. Other solutions are not working as expected for me.
Thanks,
Priya
Hello Priya,
Just checking in, did you have any other questions or concerns on this matter?
Sincerely,AndrewDeveloper Support Engineer IInfragistics Inc.www.infragistics.com/support
I have spoken to our development team on this issue about a possible resolution, and have since received a response from them. The XamDataGrid is not really set up to handle column alignment when using AutoFit. Awhile back, there was a product idea posted by another one of our community members for a XamDataTree XamDataGrid hybrid so that this alignment could be made easier. That idea has been approved and our development teams are working on it now. Below is the link to the discussion about this idea.
Link: http://ideas.infragistics.com/forums/192363-wpf/suggestions/5988260-new-wpf-tree-grid-control#comments
Please let me know if you have any other questions or concerns on this matter.
Hey Andrew,
This sample is not working as expected on my machine. Below is the screenshot:
Another option to use the aligned child fields with AutoFit = True is to use the OnlyWithVisibleStarFields option of the AutoFitMode. This mode will look for any Fields within a FieldLayout and AutoFit them based on whether their Width has a * extent or not. Below is a link to our online documentation that may provide a better description of the OnlyWithVisibleStarFields AutoFitMode.
Link: http://help.infragistics.com/Help/Doc/WPF/2012.1/CLR4.0/html/InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.AutoFitMode.html.
I have also attached an updated sample application that uses this AutoFitMode to demonstrate.
Hello Andrew,
Thank you for quick reply. I tried that. In that case it gives below layout: