Hello,
I have to use parent record item property to bind child property.
eg.
Parent Object : Item1,Item2,Item3,ObservableCollection<Child> ChildCollection
Child Object : CItem1,CItem2
Now at the time of child field binding i need parent Item to bind here.
like :
<igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout Key="boxRow"> <igDP:Field Name="Item1" Label="Item1"/> <igDP:Field Name="Item2" Label="Item2"/> <igDP:Field Name="ChildCollection" /> </igDP:FieldLayout> <igDP:FieldLayout> <igDP:Field Name="CItem1" Label="CItem1"/> <igDP:UnboundField Width="Auto" > <igDP:UnboundField.Binding> <MultiBinding Converter="{StaticResource converterKey}"> <Binding Path="CItem2"></Binding> <Binding Path="???? -> want to bind Parent Item3"></Binding> </MultiBinding> </igDP:UnboundField.Binding> </igDP:UnboundField> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts>
Hello Adit,
Thank you for your post. I have been looking into it and I can say that since the DataItem in the UnboundField is null you are not able to get the parent Record through this Binding, but you can create a Style for the Editor and get the value you need there. The UnboundField can be defined like this:
<igDP:UnboundField > <igDP:UnboundField.Settings> <igDP:FieldSettings> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamTextEditor}"> <Setter Property="Value"> <Setter.Value> <MultiBinding Converter="{StaticResource converterKey}"> <Binding Path="DataItem.CItem2"></Binding> <Binding RelativeSource="{RelativeSource AncestorType={x:Type igDP:DataRecordPresenter}}" Path="Record.ParentDataRecord.DataItem.Item3"></Binding> </MultiBinding> </Setter.Value> </Setter> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:UnboundField.Settings> </igDP:UnboundField>
Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Thanks Stefan,
Its solve my problem.Thanks a lot. One more question i just want to ask that if we have a three level (Parent -> MinChild -> Child).How i can bind Parent property in Child.
I am glad that you resolved your issue. As for your other queastion I can say that the Record has a UltimateParentRecord Property, which you can use instead of ParentRecord in the Binding's Path.
Hope this helps you.
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Thanks Stefan.
I clear my all doubts. regarding Data Record and Data Item relative bindings.
Thanks
Adit Sheth