Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hello,

                                    I'm setting the TAG property so I can check the existence of a FormatCondition by the TAG which is one of the overloads in the FormatConditions method. I've tried several variations of this code but cannot seem to get the Dim cond= line to ever be "not nothing" i.e. found the condition by the tag property. Please verify and see if this is a bug. Thank you.

                                        Private Sub CreateUserFormatConditions()
                                            If Not My.Settings.HighlightLowActivityUsers Then
                                                Return
                                            End If
                                            If Not HasLowActivityFormatCondition() Then
                                                Dim inactiveUserCondition As New DevExpress.XtraTreeList.StyleFormatConditions.StyleFormatCondition
                                                With inactiveUserCondition
                                                    .Appearance.ForeColor = System.Drawing.Color.Red
                                                    .Appearance.Options.UseForeColor = True
                                                    .ApplyToRow = True
                                                    .Column = Me.colLastLoginUtc
                                                    .Condition = DevExpress.XtraGrid.FormatConditionEnum.LessOrEqual
                                                    .Value1 = DateTime.Now.AddDays(-60)
                                                    .Tag = "activitymonitor"
                                                    Me.treeUsers.FormatConditions.AddRange(New DevExpress.XtraTreeList.StyleFormatConditions.StyleFormatCondition() {inactiveUserCondition})
                                                End With
                                            End If
                                        End Sub

                                        Private Sub RemoveUserFormatConditions()
                                            If HasLowActivityFormatCondition() Then
                                                Dim cond = treeUsers.FormatConditions("activitymonitor")
                                                treeUsers.FormatConditions.Remove(cond)
                                            End If
                                        End Sub

                                        Private Function HasLowActivityFormatCondition() As Boolean
                                            Dim cond = treeUsers.FormatConditions("activitymonitor") '<---this is what is not working, it's always NOTHING
                                            Return (cond IsNot Nothing)
                                            'Return (treeUsers.FormatConditions.Count > 1)
                                        End Function

                                0

                                Hi Neal,

                                Thanks,
                                Plato

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Your Privacy - Legal Statements

                                Copyright © 1998-2013 Developer Express Inc.
                                ALL RIGHTS RESERVED
                                All trademarks or registered trademarks
                                are property of their respective owners