Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
500
Unbound Field and DataTemplate
posted

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>