Syntax for all data from selected rows
Description
A DataWindow data expression accesses all the data in the
currently selected rows when you specify the Data and Selected properties.
Selected rows are always in the primary buffer.
Syntax
|
1 |
<span>dwcontrol</span>.Object.Data {.Primary } {.<span>datasource</span> }.Selected |
|
Parameter |
Description |
|---|---|
|
dwcontrol |
The name of the DataWindow control or |
|
datasource |
The source of the data. Values are:
|
Return values
The datatype of the expression is Any. The expression returns
an array of structures or user objects. There is one structure element
or instance variable for each column in the DataWindow object. The
datatype of each element matches the datatype of the corresponding
column.
Usage
When you specify selected rows, the expression always returns
an array, and you must assign the result to an array even if you
know there is only one row selected.
Examples
Because the primary buffer is the only applicable buffer for
selected data and current data is the default, these expressions
are all equivalent. They access data in the selected rows:
|
1 |
dw_1.Object.Data.Selected |
|
1 |
dw_1.Object.Data.Primary.Selected |
|
1 |
dw_1.Object.Data.Current.Selected |
|
1 |
dw_1.Object.Data.Primary.Current.Selected |
Both these expressions access original values for selected
rows:
|
1 |
dw_1.Object.Data.Original.Selected |
|
1 |
dw_1.Object.Data.Primary.Original.Selected |
This example takes the values in the selected rows in dw_2
and populates a DropDownDataWindow in dw_1 with the values,
replacing existing data in the DropDownDataWindow. The column with
the DropDownDataWindow is called useroptions. The columns of the
DataWindow object in dw_2 must match the columns of the
DataWindow object for the DropDownDataWindow:
|
1 |
dw_1.Object.useroptions.Object.Data = & |
|
1 |
dw_2.Object.Data.Selected |