Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • I need to loop through the individual tiles in a tile view in a subroutine.  I am calculating a custom variable to track how many tiles have a particular value in a particular element.  It was suggest to me by support in T191386 to use a For/Next loop such as:

                                        For Each item As TileViewItem In visibleTiles.Values
                                               '
                                                if  CLng(item.Elements.Item(5).Text) = 10 then
                                                   mycounter = mycounter + 1
                                                end if
                                               '
                                        Next

                                    My problem is that when I create the For Each line as suggested I get an error in the software "Visiblevalues" is not a member of Dev.Express.XtraGrid.View.Tile.TileView.

                                    Can you provide me with a VB.NET sample of how to loop through all the tiles in a tileview and be able to evaluate the value of an element and/or column value?  I can easily do this in a different layout of the Grid Control, but I am having a real problem in Tile View layout.

                                    Sierra

                                1 Solution

                                Creation Date Rating Importance Sort by
                                0

                                Hello,

                                My problem is that when I create the For Each line as suggested I get an error in the software "Visiblevalues" is not a member of Dev.Express.XtraGrid.View.Tile.TileView

                                It seems that you try to access the Visiblevalues property using code like this:

                                [C#]
                                tileView1.VisibleValues 

                                Since TileView doesn't contain any member called 'Visiblevalues' , you have that error.
                                I've prepared a small sample for you to demonstrate the approach from the TileView - Add the VisibleTiles property ticket. I hope it will be helpful for you.

                                • Sierra Fourwinds 01.12.2015

                                  We are making progress, but not there yet.  YOurs works great.  Mine does not.  It will go through my case statement one time and has an error the first time it encounters Next kvp.

                                • Hello,
                                  Thanks for the provided screenshot. As you can see the cause of the exception is that the visibleTiles collection was modified. Unfortunately, I don't see any code that changes this collection. Likely, it's changed in another place. Is it possible to provide us with a sample that illustrates the issue? It would be helpful to determine its cause. If it's not possible, please clarify in what moment you call the ComputeAssessmentTotals method and describe steps to reproduce the issue.

                                  I hope to hear from you soon.

                                • Sierra Fourwinds 01.13.2015

                                  I did have this code in the Item Customize event.  But when I was testing things above, I commented it all out.  The only other TileView event I am using is the Click event.  So there was nothing changing the tile when I ran the test.  I knew that this ItemCustomize event was being triggered so I commented it out.  Is there anything else that would cause the modification?

                                     Private Sub TileView1_ItemCustomize(sender As Object, e As DevExpress.XtraGrid.Views.Tile.TileViewItemCustomizeEventArgs) Handles TileView1.ItemCustomize
                                         '
                                         Dim view As TileView = TryCast(sender, TileView)
                                         Dim val As Integer = Convert.ToInt32(view.GetRowCellValue(e.RowHandle, "Status"))
                                         '
                                         Select Case val
                                             Case 0
                                                 e.Item.Elements(1).Image = My.Resources.Document_48
                                                 uCount_New = uCount_New + 1
                                                 uCount_Total = uCount_Total + 1
                                                 '
                                             Case 1
                                                 e.Item.Elements(1).Image = My.Resources.Document_NotDone_48
                                                 uCount_Working = uCount_Working + 1
                                                 uCount_Total = uCount_Total + 1
                                                 '
                                             Case Else
                                                 e.Item.Elements(1).Image = My.Resources.Document_Done_48
                                                 uCount_Complete = uCount_Complete + 1
                                                 uCount_Total = uCount_Total + 1
                                                 '
                                         End Select
                                         '
                                     End Sub

                                • Hello,
                                  I've tried handling ItemCustomize event, but wasn't able to reproduce this issue. Attached is a modified sample. As you can see, it oprates fine. I believe that there are certain specifics in you project. Please, provide us with a sample so we could test it on our side. If it's not possible, you can record a video (we recommend using Jing tool) that demonstrates what actions cause this exception. 
                                  I am looking forward to your response.

                                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, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners