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
285
XamDateTimeEditor Popup doesn't have a selected date
posted

On my form i have a XamDataGrid that has multiple rows of data in it.  It is a single select grid.  If you select an item in the grid you can edit a date and many other fields associated with what is selected in the grid, in controls outside of the grid.  The date I am editing does not always have a value.  So if I have selected a row where the date has a value, the date and the calendar date chooser works as expected.  However, if I select an item from the grid that does not have a date the calendar date chooser does not have a date selected at all AND it is still on the month and year of the previous selection.  

Scenario

1. Select Grid Row 1 Look below the grid at fields that are also needed for this information the XamDateTimeEditor field is set to 12/02/2013, the date is also selected in the Calendar Date Chooser

2. Select Grid Row 2 Look below the grid at fields that are also needed for this information the XamDateTimeEditor field is empty (and the datetime it is bound too is null), the Calendar Date Chooser opens to December 2013, but there is not a date selected.  I need the Calendar Date Time chooser to default to the current date (DateTime.Now).

I did see where the date property needs  to be null in order for the XamDateTimeEditor to default to today.  The date the XamDateTimeEditor is bound to is set to null if it does not have a value.  

When the date is blank I need the Calendar Date Chooser to open up with DateTime.Now() selected. 

Thank you for the help

Parents
  • 34690
    Offline posted

    Hello Laura,

    Thank you for your post.

    I followed the steps you suggested and was unable to reproduce the behavior you're describing. I created a XamDataGrid with a field of type DateTime, where one value is null. When opening the calendar view for the XamDateTimeEditor in that field, it appears that the null value defaults to DateTime.Now, as expected.

    I have attached the sample project I used to test this.  Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.

    If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using.  My test was performed using version 14.2.20142.2081 in Infragistics for WPF 2014 Volume 2.

    If the project does show the product feature working correctly, this indicates a possible problem in the code of your application.  It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.

    Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.

    Please let me know if I can provide any further assistance.

    Sincerely,
    Andrew
    Developer Support Engineer I
    Infragistics Inc.
    www.infragistics.com/support

    XDGDateTimeBlankDateCalendarCase.zip
Reply Children
No Data