Hi,
i have following hierarchical data:
WorkListItem: ... int DocumentCount List of Document Document: string Comment string DocumentState
The Property AutoGenerateField is set "False" so i defined my own FieldLayout. It works, but now i want to bind a Converter which is defined in a style to the children data. What values for Path i have to set , to pass my children properties (Document.State and Document.Comment) to the converter ?
<Style x:Key="DocumentIconStatusStyle" TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Control.Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}"> <Rectangle> <Rectangle.Fill> <MultiBinding Converter="{StaticResource DocumentStatusIconConverter}"> <Binding Path="?????"/> <Binding Path="?????"/> </MultiBinding> </Rectangle.Fill> </Rectangle> </ControlTemplate> </Setter.Value> </Setter> </Style>
Best regards
Hello,
thanks for the Project. You have set the converter in the parent FieldLayout. But for my problem , the converter has to be called at the moment when the child collection is expanding. Please check my sample.
I have created a sample project for you following your scenario and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.
with
<MultiBinding Converter="{StaticResource documentStatusIconConverter}"> <Binding Path="ChildRecords[0].ChildRecords"/> <Binding Path="ChildRecords[0].ChildRecords"/> </MultiBinding>
it also doesn't work. I get UnsetValues in die converter parameter. To find the problem i check the RecordExpanding eventhandler and find out that the RecordType is ExpandableFieldRecord and DataRecord is null. The converter is called by clicking on the ExpansionIndicator.
Since the DataContext in the Converter's Binding is DataRecord, you shoud set the Binding's Path to ChildRecords[0].ChildRecords. "ChildRecords" is a Property of DataRecord and also, setting the Path like this, you will get the entire child collection of the Record.
Hope this helps you.
i´m afraid but it didn't work :(.
My FieldLayout is defined as following:
parent field layout: <igDP:Field Width="auto" Name="Documents" Label="Dokumente" isExpandable="True"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False"/> </igDP:Field.Settings> </igDP:Field>
child field layout:
<igDP:FieldLayout ParentFieldName="Documents" Key="DocumentItem" ParentFieldLayoutKey="vw_WorkListInformation">
<igDP:Field Width="auto" Name="Name" Label="Name"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False"> </igDP:Field.Settings> </igDP:Field> <igDP:Field Width="auto" Name="Status" Label="Status"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" CellValuePresenterStyle="{StaticResource SingleDocumentStatusValueStyle}"/> </igDP:Field.Settings> </igDP:Field></igDP:FieldLayout>
So in my case this should be correct:
...
<MultiBinding Converter="{StaticResource documentStatusIconConverter}"> <Binding Path="Documents[0].Documents.Name"/> <Binding Path="Documents[0].Documents.Status"/> </MultiBinding>
....
Any ideas ?