Sorting Data is very slow - 5000+ records)

10 posts, 0 answers
  1. Benjamin
    Benjamin avatar
    5 posts
    Member since:
    Oct 2017

    Posted 15 Dec 2017 Link to this post

    Hi,

    I am new using Telerik controls (R3 2017 SP1) under Progress Developper Studio 11.7

    I have got a radGridView bind to a proBindingSource and I load my data from a Progress database using a ProDataSet.

    I thus recover my data in a temp-table which contains about 5000 records with about twenty columns. When I want to sort my data by clicking on a column the application freezes for a few minutes before sorting.

    I tried to replace the normal sorting operation of the radGridView with manual sorting to reopen the query with another sort according to the selected column.

    With this method I have my sort result in 15 seconds which is still not acceptable given that I work on a local temp-table.

     

    Is there another way to speed up sorting? Maybe i am doing something wrong but i don't see what.

  2. Hristo
    Admin
    Hristo avatar
    1323 posts

    Posted 18 Dec 2017 Link to this post

    Hello Benjamin,

    Thank you for writing.

    We are not aware of an issue in the grid which would result in the described on your end behavior. I have also tested a sample application in C# and the columns are being sorted for less than a second. I understand that you are using OpenEdge and Developer Studio, please note that for OpenEdge related topics the preferred places to submit a technical question are Salesforce and the Progress Community. You can log in to these websites straight from your Progress account: https://progresslink.progress.com/supportlink.

    Regarding your actual question, I can suggest setting the grid`s data view BypassSort property of the true. This way you will prevent the built-in data sorting mechanism in the grid to be executed while still have a visual indication. In this kind of setup, the sort descriptors can be directly applied to the underlying data source object. Please check the following documentation article providing an example: https://docs.telerik.com/devtools/winforms/gridview/sorting/basic-sorting

    In case the issue persists please open a case in Salesforce and send us your project so that we can test it locally.

    I hope this helps. Let me know if you have other questions.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Benjamin
    Benjamin avatar
    5 posts
    Member since:
    Oct 2017

    Posted 18 Dec 2017 Link to this post

    Hi,

    Thank you for your reply.

    I just implemented the "ByPassSort" property as well as the code below on the "SortChanging" event and this solves my problem.

    I would open a ticket from Progress Support occasionally to find out if it's normal that the base sort of the gridView Telerik is as long when the grid is bind to a proBindingSource.

     

    Here is the code:

     

    radGridView1:MasterTemplate:DataView:BypassSort = TRUE.

     

    METHOD PRIVATE VOID radGridView1_SortChanging( INPUT sender AS System.Object, INPUT e AS Telerik.WinControls.UI.GridViewCollectionChangingEventArgs ):
        
            DEFINE VARIABLE iItem     AS INTEGER                                       NO-UNDO.
            DEFINE VARIABLE lSortDesc AS LOGICAL                                       NO-UNDO.
            DEFINE VARIABLE oDesc     AS Telerik.WinControls.Data.SortDescriptor       NO-UNDO.
            DEFINE VARIABLE oGrid     AS Telerik.WinControls.UI.MasterGridViewTemplate NO-UNDO.
        
            lSortDesc = FALSE.
          
            oGrid = CAST (sender, Telerik.WinControls.UI.MasterGridViewTemplate).
          
            IF VALID-OBJECT(e:NewItems) THEN 
            DO:
                DO iItem = 1 TO e:NewItems:Count:
                    oDesc = CAST(e:NewItems:Item[iItem - 1], Telerik.WinControls.Data.SortDescriptor).
                    IF oDesc:Direction = System.ComponentModel.ListSortDirection:DESCENDING THEN 
                        lSortDesc = TRUE.
                     cSortBy = SUBSTITUTE ("BY &1 &2", REPLACE(oDesc:PropertyName,":","."), STRING(lSortDesc,"DESCENDING/")).
                END.
            END. 
                  
            cPrepare = SUBSTITUTE("PRESELECT EACH ttCustomer &1", cSortBy).
        
            DATASET dsCustomer:TOP-NAV-QUERY:QUERY-PREPARE (cPrepare).
            DATASET dsCustomer:TOP-NAV-QUERY:QUERY-OPEN ().     
           
    RETURN.

    END METHOD.

  4. Hristo
    Admin
    Hristo avatar
    1323 posts

    Posted 18 Dec 2017 Link to this post

    Hello Benjamin,

    Thank you for the update.

    I am glad that you have achieved a working solution for your project. The BypassSort and ByPassFilter properties were introduced to handle mainly a scenario using OpenEdge due to the specifics of the ProBindingSource object.

    I hope this information was useful. Let me know if you have other questions.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Benjamin
    Benjamin avatar
    5 posts
    Member since:
    Oct 2017

    Posted 18 Dec 2017 Link to this post

    Hi,

    Is it normal that when I activate the property "ByPassSort" I can not use the filters anymore?

    There is however a property "ByPassFilter" which is FALSE in my case...

    (When i turn off "ByPassSort" everything is fine)

  6. Hristo
    Admin
    Hristo avatar
    1323 posts

    Posted 18 Dec 2017 Link to this post

    Hi Benjamin,

    Thank you for writing back.

    We are aware of this issue and it is logged on our feedback portal, here: FIX. RadGridView - setting the BypassSort property to true disables filtering in the grid. We will do our best to include a fix for it with the upcoming R1 2018 release scheduled for the middle of January.

    I hope this helps. Let me know if you have other questions.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Benjamin
    Benjamin avatar
    5 posts
    Member since:
    Oct 2017

    Posted 21 Dec 2017 Link to this post

    Hi,

    Is there a way to reset the sort indicator of a header column ?

    My grid is initially sorted by code. Then I allow the user to sort as he wishes. I added a button to initialize the grid with the original sort and I would like the sort indicator of the previously sorted column to be initialized.

     

    Any sample code in C# is welcome I'll translate it.

  8. Hristo
    Admin
    Hristo avatar
    1323 posts

    Posted 22 Dec 2017 Link to this post

    Hello Benjamin,

    Thank you for writing.

    The sort indicator is intended to be used only for columns which have an applied sort order. Since you need to display some kind of indication of a column which has been sorted previously, you can consider creating a custom cell. The following thread discusses a similar scenario: https://www.telerik.com/forums/button-in-first-header-cell-04c90a7484de.

    You can also consider formatting particular header cells with custom styles: https://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells#formatting-non-data-cells.

    I hope this helps. Let me know if you need further assistance.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  9. Benjamin
    Benjamin avatar
    5 posts
    Member since:
    Oct 2017

    Posted 27 Dec 2017 in reply to Hristo Link to this post

    Hello,

    Thank you for your reply.

    That's not what I was looking for. As I use the property "ByPassSort" change management of the column header with the sort indicator is left to the system. I just wanted to reset this indicator when pressing a button.

    I finally found how to do it but thanks for your help.

     

    Here is the code:

    DEFINE VARIABLE i AS INTEGER NO-UNDO.

    DO i = 0 TO radGridView1:ColumnCount - 1: 
        radGridView1:Columns[i]:SortOrder = Telerik.WinControls.UI.RadSortOrder:NONE.
    END.

  10. Hristo
    Admin
    Hristo avatar
    1323 posts

    Posted 27 Dec 2017 Link to this post

    Hi Benjamin,

    Thank you for writing.

    Indeed that is the correct way to remove any applied sort descriptors and to also remove the sorting indicator. 

    Let me know if you have other questions.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top