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
475
Setting default value for the XamDateTimeEditor’s dropdown XamMonthCalendar when first cell in a new row
posted

Hi,

 

I have a grid that looks like the following…

The first field in the underlying data row object is a DateTime using the following XAML.

 

<igDP:Field Name="RowDateTime">

       <igDP:Field.Settings>

              <igDP:FieldSettings EditAsType="{x:Type sys:DateTime}">

                     <igDP:FieldSettings.EditorStyle>

                           <Style TargetType="{x:Type igEditors:XamDateTimeEditor}">

                                  <Setter Property="Mask" Value="{}{date} {time}" />

                           </Style>

                     </igDP:FieldSettings.EditorStyle>

              </igDP:FieldSettings>

       </igDP:Field.Settings>

</igDP:Field>

 

I want the user to be able to add new rows by just editing in the add row area.  Initially on the new row the date time is empty and if they hit the dropdown button it defaults to today’s date.  But what I need is for the new date time to default to 1 hour after the current latest time in the grid ie. In above case I want 01/01/2004 01:00 plus one hour ie. 01/01/20004 02:00. 

 

However, no where can I see how to do this for the XamDataGrid.    The RecordAdding event occurs after the user tabs away from (finishing editing) the date field.  The InitializeTemplateAddRecord event initializes the field before any edit takes place.

 

The date field has to be the first one – I don’t have the option to move it as we are updating from an old C++ grid and have to maintain compatability.

 

Please can you advise how to do this.  As usual very, very difficult to configure trivial things in the XamDataGrid.  Makes the 10 year old Objective Grid seem like quality.