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.
12 Answers, 1 is accepted
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
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.
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
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)
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
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.
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
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.
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
Hello Benjamin,
I've got the same problem.
Did you get any answer from Progress-Support?
Regards, Marc
Hello Marc,
See below Progress-Support's answer .... (it was a year ago)
Regards,
---------------------------------
Created By: Paul (Mon Dec 18 11:39:22 GMT 2017)
Hi Benjamin,
Does the attached article help?
Regards,
Paul.
https://knowledgebase.progress.com/articles/Article/How-to-improve-performance-of-RadGridView-sorting
-------------------------------------
Created By: Benjamin (Mon Dec 18 12:58:31 GMT 2017)
Hi,
I already used this mechanism. It works fine but I thought maybe since the time (this article is already over a year old) a solution to fully utilize the capabilities of telerik components would have emerged.
Custom sorting isn't realy hard to implement but i'll have to do the same with filtering and grouping and so i don't realy understand why use Telerik controls if their basic mechanisms don't work with OpenEdge...
Regards,
------------------------------
Created By: Paul (Mon Dec 18 14:07:29 GMT 2017)
Hi Benjamin,
Thank you for the feedback. Unfortunately I doubt this has changed in the last year. The explanation for the behaviour is here:
https://community.progress.com/community_groups/openedge_development/f/19/t/26959
You could try the latest versions of the controls, but I suspect the control will still interact with the bindingSource in the same way, so would still experience the problem.
Regards,
Paul.
Hello Benjamin,
vielen Dank! Thank you!
Regards