Kbase P165114: Infragistics UltraGrid not communicating changes back to the proBindingSource when GroupBy column is
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  01/07/2010 |
|
Status: Verified
SYMPTOM(s):
Infragistics UltraGrid not communicating changes back to the proBindingSource when GroupBy column is chosen by user
Grouped data incorrect after deleting a record in the UltraGrid
FACT(s) (Environment):
Windows
OpenEdge 10.2x
CAUSE:
Bug# OE00198099
CAUSE:
The UltraGrid does not update the proBindingSource with potential query changes
FIX:
To workaround this issue insert the below code into your form. After opening the query this code refactors the groups for all of the rows in the grid and places them into the correct group.
DEFINE TEMP-TABLE ttGridRow NO-UNDO
FIELD row AS Progress.Lang.Object
.
DEFINE TEMP-TABLE ttExpandedGroups NO-UNDO
FIELD rowValue AS Progress.Lang.Object.
DEFINE VARIABLE enumerator AS System.Collections.IEnumerator NO-UNDO.
DEFINE VARIABLE gridRow AS Infragistics.Win.UltraWinGrid.UltraGridRow NO-UNDO.
DEFINE VARIABLE groupByRow AS Infragistics.Win.UltraWinGrid.UltraGridGroupByRow NO-UNDO.
enumerator = ultraGrid1:DisplayLayout:Bands[0]:GetRowEnumerator(Infragistics.Win.UltraWinGrid.GridRowType:GroupByRow):GetEnumerator().
DO WHILE enumerator:moveNext():
groupByRow = CAST(enumerator:Current,Infragistics.Win.UltraWinGrid.UltraGridGroupByRow).
IF VALID-OBJECT(groupByRow) AND
groupByRow:Expanded = YES THEN
DO:
CREATE ttExpandedGroups.
ASSIGN
ttExpandedGroups.rowValue = groupByRow:Value.
END.
END.
hQuery:query-open().
enumerator = ultraGrid1:DisplayLayout:Bands[0]:GetRowEnumerator(Infragistics.Win.UltraWinGrid.GridRowType:DataRow):GetEnumerator().
DO WHILE enumerator:moveNext():
gridRow = CAST(enumerator:Current,Infragistics.Win.UltraWinGrid.UltraGridRow).
IF VALID-OBJECT(gridRow) THEN
DO:
CREATE ttGridRow.
ASSIGN
ttGridRow.row = gridRow.
END.
END.
FOR EACH ttGridRow EXCLUSIVE-LOCK:
gridRow = CAST(ttGridRow.row,Infragistics.Win.UltraWinGrid.UltraGridRow).
gridRow:RefreshSortPosition().
DELETE ttGridRow.
END.
FOR EACH ttExpandedGroups EXCLUSIVE-LOCK:
enumerator = ultraGrid1:DisplayLayout:Bands[0]:GetRowEnumerator(Infragistics.Win.UltraWinGrid.GridRowType:GroupByRow):GetEnumerator().
DO WHILE enumerator:moveNext():
groupByRow = CAST(enumerator:Current,Infragistics.Win.UltraWinGrid.UltraGridGroupByRow).
OUTPUT TO j:\employee\bheavican\uom.txt APPEND.
PUT UNFORMATTED ttExpandedGroups.rowValue:ToString() SKIP.
OUTPUT CLOSE.
IF VALID-OBJECT(groupByRow) AND
Progress.Util.EnumHelper:Equals(groupByRow:Value,CAST(ttExpandedGroups.rowValue,System.Object)) AND
groupByRow:IsExpanded = NO AND
group.ByRow:IsExpandable = YES THEN
groupByRow:Expanded = YES.
END.
DELETE ttExpandedGroups.
END.
.