Bug Report T335319
Visible to All Users

The Range.Value.IsDateTime property returns False even if a cell range consists of a single cell with a DateTime value

created 9 years ago

Context :  Office 2007 in french

Problem 1
========
Value.IsDateTime always return false.

sample code (in linked sample project) :
using (var workbook = new Workbook())
            {
                workbook.LoadDocument(@"…\CrossRefFormulaSample2.xlsx");
                var sh = workbook.Worksheets["sheet1"];
                MessageBox.Show("sh[D5] is a datetime ? " + sh["D5"].Value.IsDateTime);
            }

Problem 2
=======
With worksheet.Import, import a DataTable with a datetime will randomly put this date in US format or in correct culture language (french here) specified in workbook and in thread…

Comments (2)
DevExpress Support Team 9 years ago

    Hello Alexandre,

    I just want to inform you that I need a bit more time to finish working on replicating the issue on our side to provide you with a precise answer.
    I appreciate your patience.

    DevExpress Support Team 9 years ago

      Usually, we avoid discussing multiple questions within the same thread because this makes it difficult to track the entire conversation. Therefore, I have moved your next question to a separate thread: Date is randomly imported in the US or French date format.

      Answers approved by DevExpress Support

      created 9 years ago (modified 9 years ago)

      We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

      Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Additional information:

      After applying the fix, the Range.Value.IsDateTime property will be calculated for a range that consists of a single cell

        Comments (2)
        AR AR
        Alexandre Richonnier 9 years ago

          Please, is this fix will  be automatically include in your next release or I need to ask a hotfix ?

          DevExpress Support Team 9 years ago

            Hello,

            Yes, the fix will be included in v15.2.5 and v15.1.10. If this is a matter of urgency, you can request an intermediate build that contains a public fix for this issue by clicking "Request hotfix" on this page. This intermediate build will be prepared within a couple of days.

            created 9 years ago

            I have researched the project you provided and found that you checked the IsDateTime property of the DevExpress.Spreadsheet.Range object, not a cell. Correct the code as suggested below to achieve your goal:

            C#
            bool isDateTime = sh.Cells[sh["D5"].TopRowIndex, sh["D5"].LeftColumnIndex].Value.IsDateTime;

            Please refer to the How to: Access a Cell in a Worksheet or How to: Access a Range of Cells help topic for clarification.

              Comments (2)
              AR AR
              Alexandre Richonnier 9 years ago

                Hi Yulia,
                Thank you for your help.
                I'm partially agree with you…
                A range can be a cell and Value is a CellValue and in my case, as in syncfusion, it is.
                That's why sh["D5"].Value have type CellValue and a Value.IsDateTime .
                If you are considering that a range cannot have a property like Value.IsDateTime , then remove it.
                Otherwise, can you fix it please ?

                DevExpress Support Team 9 years ago

                  By default, the Range.Value property returns a value of the top left cell in a range. I agree with you that the Range.Value.IsDateTime property behaves confusing in this case, and its value can be calculated if the cell range consists of a single cell. I have passed this ticket to our developers. They will research this subject and consider the ways of changing the current behavior.

                  Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                  Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.