Property SelectedRows: Bookmark collection (R)
Description
Specifies a set of bookmarks for all the records in the dataset that correspond to rows selected in the grid.
Use this property in combination with the DataSet properties DisableControls, EnableControls and BookMark to implement a multiselectable grid.
Note: A multiselectable grid can only be implemented if the properties Footer, ColumnSorting and GroupByBox are all set to false.
Code Snippet
rem Multiselect can only be activated if idbgridPart.ColumnSorting = false,
remidbgridPart.Footer = false, idbgridPart.groupbybox = false
rem It is not possible so set these properties during runtime and preserve the
rem multiselected records.
Dim
cMultiSelectString
Dim
i
MsgBox
"Selected row(s): "
& idbgridPart.SelectedRows.Count
idbgridPart.DataSource.DataSet.DisableControls
For
i =
0
to (idbgridPart.SelectedRows.Count
-1
)
dsPart.DataSet.BookMark = idbgridPart.SelectedRows.
Items
(i)
msgbox
dsPart.DataSet.Fields(0).Value
Next
idbgridPart.DataSource.DataSet.EnableControls