Bug Report T458217
Visible to All Users

TreeListView raises an exception when conditional formatting is applied to a column with DBNull.Value values

created 8 years ago (modified 8 years ago)

Hello,

I am using DevExpress 15.1.8 WPF GridControl with the TreeListView and binding ItemsSource to a DataTable object. The DataTable has cells where the value is null (DBNull.Value). However, when enabling conditional formatting on one of the columns with the option "Top 10 Items" an unhanlded exception is thrown:

System.ArgumentException: Object must be of type Double.
    at System.Double.CompareTo(Object value)
    at System.Collections.Comparer.Compare(Object a, Object b)
    at System.Linq.EnumerableSorter`2.CompareKeys(Int32 index1, Int32 index2)
    …
    at DevExpress.Xpf.Grid.TreeList.TreeListSummarySortedList.Finish(TreeListNode node)
    at DevExpress.Xpf.Grid.TreeList.TreeListDataProvider.CalcSummary(IEnumerable`1 summary)
    at DevExpress.Xpf.Grid.TreeList.TreeListDataProvider.DoRefreshCore(Boolean forceResort)
    at DevExpress.Xpf.Grid.TreeList.TreeListDataProvider.EndUpdate()
    at DevExpress.Xpf.Grid.DataControlBase.OnColumnUnboundChanged()
    at DevExpress.Xpf.Core.Native.EndInitPostponedAction.PerformIfNotLoading(Action action, Action actionWhenLoading)
    at DevExpress.Xpf.Grid.GridControl.AttachToFormatConditions(FormatConditionChangeType changeType)
    …

Any idea how to make conditional formatting work if the underlying ItemsSource contain null values?

Thank you!

Comments (1)
Andrey K (DevExpress Support) 8 years ago

    Hi,

    We have reproduced the behavior you described and passed this ticket to our developers for further research. Please bear with us. We will notify you as soon as we make any progress.

    Thanks,
    Andrey

    Answers approved by DevExpress Support

    created 8 years ago (modified 8 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.

      Comments (3)
      DevExpress Support Team 8 years ago

        Hi,

        We have published the requested patched build and are looking forward to hearing about your results.  Meanwhile, we would like to mark this ticket as Public, if you do not mind, to include it in the What's New lists for future maintenance updates.

          Great, sure you can make the ticket public.

          DevExpress Support Team 8 years ago

            Thank you, Mike! I have marked this thread as public.

            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.