On a toolbar manager button event I would like to process an action on each selected row of a specific band from an UltraGrid.
I have read many postings on this form but none of them explain clearly how to capture the selected rows of a specific band in the grid.
The grid band is [1] with the name "ttReceiptLines". Would prefer using names over index numbers (more clear for reading source which data object you work on).
What kind of object do I need to capture the selected rows? Can this be a RowsCollection?
How can I process each item of the collection to read info from them?
Need to identify the line number, the quantity and other line info to process and forward them to an other Receipt List.
Kind regards,
Peter Wokke
Hello Dimitar,
I have found this mistake and use an object which is a type of SelectedRowsCollection now.
In Progress language I forward this example for you.
Kind regards and thanks,
Peter.
define variable clsSelectedRows as SelectedRowsCollection no-undo.
define variable clsCurrentRow as UltraGridRow no-undo.
define variable clsCells as CellsCollection no-undo.
define variable clsCell as UltraGridCell no-undo.
define variable iOrderNumber as integer no-undo.
define variable iOrderLine as integer no-undo.
define variable iPackings as integer no-undo.
clsSelectedRows = ultraGridShipment:Selected:Rows.
do iIndex = 0 to clsSelectedRows:count - 1 :
clsCurrentRow = clsSelectedRows[iIndex].
if clsCurrentRow:Band:Key = "ttReceiptLines" then do:
clsCells = clsCurrentRow:Cells.
clsCell = clsCells:item["OrderNumber"].
iOrderNumber = integer(clsCell:Text).
clsCell = clsCells:item["LineNumber"].
iOrderLine = integer(clsCell:Text).
clsCell = clsCells:item["Packings"].
iPackings = integer(clsCell:Text).
message "Receipt line is: " iOrderNumber iOrderLine
skip "Number of packings is :" iPackings
view-as alert-box.
end.
I
Hi Peter,
I am glad that your issue is resolved. Please let me know if you have any additional questions.
Thank you for using Infragistics Components.