Multilevel grid and repositioning

Posted by mstassen on 05-Sep-2013 09:28

I hav a multilevel grid that can-be shown like this when the user expand rows:

+ order 1

+ order 2

-  order 3

orderline 1

orderline 2

orderline 3

+ order 4

+ order 5

When the user selects order 3, orderline 2 (will become the active row) i want the grid after refresh to reposition back to order 3, orderline 2.

I only get this working (repositioning) to the first level (orders) but not the second.

How can i do that ?

All Replies

Posted by PhilipPoulain on 05-Sep-2013 09:40

Hi Maurice,

Likely, we are doing the same thing today.

I have the same problem here.

I have the impression that there is a deffirence in behaviour between OE 11.0 and OE 11.2 too.

Does someone have the solution?

Philip.

Posted by mstassen on 05-Sep-2013 10:09

I found a solution, but i don't see the whole impact of it.

When initiating the form you need BindingSource:AutoSync = TRUE.

Otherwise you don't see any data.

But when refreshing again you don't need that anymore I think:

IF NOT glIsStarting THEN /* 9756-2 */

TripBindingSource:AutoSync = FALSE.

GetTripData().

IF NOT glIsStarting THEN /* 9756-2 */

TripBindingSource:AutoSync = TRUE.

This works for me as far as I can see now.

Can you tell me if this works for you too ?

Met vriendelijke groet,

Maurice Stassen

Software Engineer - Projectleider

E-mail mstassen@datamex.nl

Datamex Automatisering B.V. Telefoon (076) 5 730 730

Minervum 7368, 4817 ZH Breda Fax (076) 5 877 757

Postbus 5515, 4801 DT Breda Internet www.datamex.nl

Posted by PhilipPoulain on 06-Sep-2013 02:04

Hi Maurice,

Turning off AutoSync for the bindingsource is just a part of the solution.

I let the grid do the sorting for me and I do the updating of the data with a separate dialog-box.

After the updating, I reopen the top-nav-query so the modified data is presented/sorted correctly in the grid.

From OE 11.2 on, after reopening the query the grid is presented with all rows collapsed and no selected/activated row.

Turning BindingSource:AutoSync off resolves the collapsed presentation but not the problem with the selected/activated row.

Only way to resolve this one I found so far is the following: (Assuming the data you want to change has an unique id (e.g. a sequence).

Before updating I store that sequence in a variable.

After updating i invoke this method:

METHOD PRIVATE VOID ActivateMyRow( INPUT piSequence AS INTEGER ):

DEFINE VARIABLE myHeaderRow AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.

DEFINE VARIABLE myDetailRow AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.

DEFINE VARIABLE idx AS INTEGER NO-UNDO.

DEFINE VARIABLE lOk AS LOGICAL NO-UNDO.

OUTER:

DO idx = 0 TO ( THIS-OBJECT:TTLevOrderGrid:Rows:Count - 1 ):

myHeaderRow = THIS-OBJECT:TTLevOrderGrid:Rows:Item[idx].

IF myHeaderRow:HasChild() EQ TRUE THEN

DO:

myDetailRow = myHeaderRow:GetChild(Infragistics.Win.UltraWinGrid.ChildRow:First).

lOk = TRUE.

DO WHILE lOk = TRUE:

IF UNBOX(myDetailRow:GetCellValue("Lbestellijn-seq")) = piSequence THEN

DO:

THIS-OBJECT:TTLevOrderGrid:ActiveRow = myDetailRow.

myDetailRow:SELECTED = TRUE.

LEAVE OUTER.

END.

IF myDetailRow:HasNextSibling() EQ TRUE THEN

myDetailRow = myDetailRow:GetSibling(Infragistics.Win.UltraWinGrid.SiblingRow:Next).

ELSE lOk = FALSE.

END.

END.

END.

RETURN.

END METHOD.

I searched the internet for days now, and it seems to me the only resolution, but i'm not sure.

Other suggestions?

Met vriendelijke groet,

 

This thread is closed