First, I would say XamTreeGrid is a fantastic control ; this a common UI need in our application. We achieved all we had expected except one thing : resizing row height based on a condition.
We have a simple case that says :
If Node has children, Row Heigtht is 25 ; if not Row Height is 50. I tried everything, redefine CellValuePresenterStyle, DataRecordPresenterStyle, DataRecordCellAreaStyle, nothing works. We cannot use DataRecordSizingMode, cause the sizing does not depend on text Content (Wrapping) but on a cell template (a grid with 3 rows).
If you have an idea, I take it. Thanks
Stéphane
Hello Stéphane,
Thank you for the feedback. I am glad, that you have found a solution to your issue.
Hi,
I figured out what was wrong in my case.
Actually I need to create dynamic fields and I use a custom control template which contains a grid with 3 rows ; I didn't manage the visibility of this grid (visible only for nodes with no children), but the height of the grid overrides the height set by the trigger.
Thanks for you great support.
Attaching the screenshot.
I have been looking into your latest post and I was not able to reproduce the issue that you have mentioned, using the sample application from my previous post. I have created a screenshot for you to see the behavior on my side. On the screenshot - a record with children and one without children are selected and the third one is hovered.
Would you please provide the sample application with the functionality you are using, so it reproduces the issue? This way I would be able to further investigate this matter for you and provide you with further information.
Looking forward to hearing from you.
Thanks for your quick answer.
I tried as you did:
<Style TargetType="{x:Type igDP:TreeCellValuePresenter}">
<Setter Property="Height" Value="40"/>
<Style.Triggers>
<Trigger Property="ExpansionIndicatorVisibility" Value="Visible">
<Setter Property="Height" Value="20">Setter>
Trigger>
Style.Triggers>
Style>
The thing is, the height is bigger when no children, that's ok. But the height of nodes with children does not fit (20).
Actually, cells have 20 for height but the record not (it's bigger).
See attachment. The selected cell seems 20 for height, but the record seems 30.