Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • The application is written in VB6 using dxdbGrid control. While setting focus to any record in the top rows takes no time, setting focus to any record near the bottom of the grid or the end of the list take quite a while. The list has only 400 records but it takes about 10-15 seconds. The question is what is really happening in the process of setting focus to a particular row. Thanks for your help!

                                    Here is the sample code:

                                    Public Sub ApplyGridSettings(ByRef Grid As dxDBGrid, ByRef gSettings As GridSettings)
                                      Dim Node As dxGridNode
                                      Dim i As Long
                                      
                                        Grid.m.BeginUpdate
                                        For i = 0 To gSettings.selectedcount - 1
                                            Set Node = Grid.m.FindNodeByKeyValue(gSettings.SelectedNodes(i))
                                            If Not Node Is Nothing Then
                                                Node.Selected = True
                                            End If
                                        Next
                                        ReDim gSettings.SelectedNodes(1)
                                        Set Node = Grid.m.FindNodeByKeyValue(gSettings.FocusedID)
                                        If Not Node Is Nothing Then
                                            Node.Focused = True ' <----- this takes a long time when the node is near the bottom of the grid.
                                            Grid.ex.topindex = Node.AbsoluteIndex - gSettings.FocusedIndex
                                        End If
                                        Grid.m.EndUpdate
                                    End Sub

                                0

                                Hi Allan,

                                I'm afraid this information isn't sufficient to precisely identify the cause of the problem. Which data source are you using for your Grid? If this is an external recordset, please bind it to a standard MS DataGrid, and try to navigate its rows. What are you results?

                                If you're using the Grid's internal data sources (ADODataset, Unbound Mode or Memory Data), please verify that you don't perform time-consuming operations when navigating through the Grid. Reset all its event handlers to see whether the problem disappears. Then, restore them one-by-one to detect when it comes back.

                                In any case, please keep me informed about your progress.

                                Thanks,
                                Serge

                                0

                                Thanks for replying!

                                The grid is binding to an internal ADODataset recordset that was returned from a stored procedure in SQL. To be simple, What I try to do is to update the selected record in the database with certain data when the user clicks on that record in the grid.

                                The way the code is written now is that it first closes the grid's dataset (grid.dataset.close), finds and updates the selected record in the recordset, re-open the grid's dataset (grid.dataset.open) and calls that ApplyGridSettings to select and set focus back to the row (or rows) that was clicked on. For some reasons, setting Node.Focused = true takes quite a while to complete.

                                Let me ask another question: when I click on a row in the grid, does it move the cursor to where the record is in the recordset internally?

                                Thanks again for your help!

                                0

                                Hi,

                                We are sorry for the delay in responding. We are working on this issue and will contact you soon. Please bear with us.

                                Thanks

                                0

                                Hi,

                                Sorry, it took us significant time to research the situation. Unfortunately, our tests don't produce such delays. Perhaps there are other things involved at your end. Could you please supply us with a sample project demonstrating this problem? We can then take a look at it, and try to find a solution.

                                Thanks,
                                Serge

                                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.

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