I have an unbound field which I'm assigning the ContentTemplate property of the CellValuePresenter to some Data Template I've defined. How do I bind the data template to the data of the unbound field? Currently what I've tried shows no value (blank).
This is my field:
<igDP:UnboundField Name="ServiceDate" Label="Service Date" BindingMode="TwoWay" BindingPath="ServiceDateUTC"
Visibility="Visible" >
<igDP:UnboundField.Settings >
<igDP:FieldSettings LabelWidth="100" CellWidth="100" AllowEdit="True"
InvalidValueBehavior="RetainValue" EditorType="{x:Type igEditors:XamDateTimeEditor}">
<igDP:FieldSettings.CellValuePresenterStyle>
<Style TargetType="{x:Type igDP:CellValuePresenter}" >
<Setter Property="ContentTemplate">
<Setter.Value>
<MultiBinding Converter="{StaticResource IndexToTemplateConverter}">
<MultiBinding.Bindings>
<Binding RelativeSource="{RelativeSource Self}"/>
<Binding Path="Record.Index" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:DataRecordCellArea}}"/>
</MultiBinding.Bindings>
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</igDP:FieldSettings.CellValuePresenterStyle>
</igDP:FieldSettings>
</igDP:UnboundField.Settings>
</igDP:UnboundField>
and this is the DataTemplate I'm assigning (through the converter):
<DataTemplate x:Key="dateTimeTemplate">
<igEditors:XamDateTimeEditor
BorderBrush="Transparent"
IsInEditMode="{Binding RelativeSource={RelativeSource AncestorType={x:Type igDP:CellValuePresenter}}, Path=IsInEditMode}"
Value="{Binding Path=Record.DataItem.ServiceDateUTC, Mode=TwoWay, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:DataRecordCellArea}}}"
AutoFillDate="Year" DropDownButtonDisplayMode="Always" Mask="{}{date}" />
</DataTemplate>
Hello,
I am just checking if you require any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
In the code that you provided, is it possible to pass Record.DataItem.ServiceDateUTC instead of Record.Index? I tried that but what I got for the value was DependencyProperty.UnsetValue.