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
20
DateTimeField custom format
posted

Is format property for DateTimeField bindable? I am looking to get datetimeformat from user preferences and bind it to format property. Mask property does not support dd/MMM/yyyy which is why i am looking into format

Parents
No Data
Reply
  • 2490
    Offline posted

    Hello Macus, 

    You can use a field in XamDataGrid and set its editor style to be XamDateTimeEditor. For example :


    <igDP:Field>
     <igDP:Field.Settings>
      <igDP:FieldSettings>
       <igDP:FieldSettings.EditorStyle>
        <Style TargetType="{x:Type igEditors:XamDateTimeEditor}" >
         <Style.Setters>
          <Setter Property="Format" Value="{Binding ElementName=comboFormat, Path=Value}"/>
           <Setter Property="Mask" Value="dd/MM/yyyy"/>
          </Style.Setters>
          </Style>
         </igDP:FieldSettings.EditorStyle>
        </igDP:FieldSettings>
       </igDP:Field.Settings>
     </igDP:Field>

    I have created a sample which uses XamComboEditor for selection different formats, which will be applied to the field. You can find it as an attached file.

    XamDataGrid_DateTime.zip
Children
No Data