Kontrolka UltraGrid z wersji 10.2B - bardzo słaba wydajność

Posted by Dariusz Lipiec on 18-Jul-2016 07:47

Poniższy kod - browse dla pojedynczej tablicy na kontrolce UtraGrid uruchamia się b.szybko - ok. 1sek.

Ale sortowanie w browsie (kliknięcie w nagłówek kolumny), trwa ok. 30-40 sek (tablica ma ok.40.000 rekordów).

W tym czasie procesor dostaje obciążenia niemal 100%, a transfer po sieci LAN pokazuje wysoki %.

Męczę się z tym parę godzin ...

Ma ktoś jakiś pomysł co to może być?

/* QueryBinding.p
Bind to a Customer query and display the entire table in an Infragistics
UltraWinGrid */
/* USING statements must be the first in the procedure. Note that you could
have USING statements for the OpenEdge classes also.*/
USING System.Windows.Forms.*.
USING Infragistics.Win.UltraWinGrid.*.
DEFINE VARIABLE rMainForm AS Progress.Windows.Form NO-UNDO.
DEFINE VARIABLE rCustGrid AS UltraGrid NO-UNDO.
DEFINE VARIABLE rBindS AS Progress.Data.BindingSource NO-UNDO.
DEFINE VARIABLE controls AS Control+ControlCollection NO-UNDO.
DEFINE VARIABLE hCustQuery AS HANDLE NO-UNDO.
CREATE QUERY hCustQuery.
hCustQuery:SET-BUFFERS(BUFFER a_asortyment:HANDLE).
hCustQuery:QUERY-PREPARE("PRESELECT EACH a_asortyment").
hCustQuery:QUERY-OPEN.
/* This will display all of the Customer fields in the grid. */
rBindS = NEW Progress.Data.BindingSource(hCustQuery).
/* Alternately, specify fields using the optional include-fields and
except-fields lists. */
/* rBindS = NEW Progress.Data.BindingSource(hCustQuery,
"CustNum,Name,Address,City,PostalCode,Phone,Contact,Salesrep",""). */
/* Disable editing because procedure does not include event logic to handle
changes. */
rBindS:AllowEdit = FALSE.
rBindS:AllowRemove = FALSE.
/* Main block */
IF VALID-OBJECT(rBindS) THEN
DO ON ERROR UNDO, LEAVE:
rMainForm = NEW Progress.Windows.Form().
rMainForm:Width = 840.
rMainForm:Height = 500.
rMainForm:Text = "Customer Form".
rCustGrid = NEW UltraGrid().
rCustGrid:Left = 10.
rCustGrid:Top = 10.
rCustGrid:Width = 810.
rCustGrid:Height = 420.
rCustGrid:Name = "CustomerGrid".
rCustGrid:Text = "Customer Grid".
rCustGrid:DataSource = rBindS.
rCustGrid:TabIndex = 1.


/*Hide the first column, as it is unnecessary*/
/*rCustGrid:DisplayLayout:Bands[0]:Columns["OID"]:Hidden = TRUE.*/


/* Enable grid column filtering through the use of header icons*/
rCustGrid:DisplayLayout:Override:FilterUIType = FilterUIType:HeaderIcons.
/* Perform a column RESIZE */
/* rCustGrid:DisplayLayout:PerformAutoResizeColumns(false, PerformAutoSizeType:AllRowsInBand).*/


rCustGrid:DisplayLayout:Override:AllowColSizing = AllowColSizing:Free.
rCustGrid:DisplayLayout:Override:HeaderClickAction = HeaderClickAction:SortSingle /*SortMulti*/ /*ExternalSortSingle*/.
/*rCustGrid:DisplayLayout:ScrollStyle = ScrollStyle:Immediate.*/

rCustGrid:Name = "UltraGrid1".

controls = rMainForm:Controls.
controls:Add(rCustGrid).
WAIT-FOR Application:RUN(rMainForm).
END. /* Main block */

All Replies

This thread is closed