|
|
DataGrid Selection Newbie Question
Posted: 25 Jul 08 1:59 PM
|
I have a datagrid with the multi select property checked but when I try to loop through the selected items it only returns those visible at the time the command is fired.
example 1: The data grid has 100 records in it and I 'select' the first 50 (but only 20 are visible at any one time on the screen with out scrolling) but datagrid.selection.count only returns 20...???
example 2: The data grid has 100 records in it and 'Select' every 10th item for 10 total (only 2 are visible on the grid at a time with out scrolling) but datagrid.selection.count only returns 2
What am I doing wrong?
Thanks in advance! |
|
|
|
Re: DataGrid Selection Newbie Question
Posted: 26 Jul 08 1:07 AM
|
You aren't doing anything wrong. That's a normal complaint of the datagrid - that particular method of identifying all the rows that are selected is completely marred by the fact that it only returns the visible ones. You might be able to imitate the functionality, though. Build a one-field recordset from scratch that will contain the IDs of the records selected (acting like a collection in a compiled language), then attach a function to either the OnClick event or the OnRowSelect event of the datagrid, and determine whether to add or remove an ID from the recordset in that function. I haven't tried it myself, but it might accomplish what you are looking for. The alternative would be to add an additional column to the datagrid that is a checkbox, and the user can check the boxes rather than select rows (which would update the recordset behind the datagrid), and when you want to determine which records are selected, poll the recordset for all the checked rows. |
|
|
|
Re: DataGrid Selection Newbie Question
Posted: 26 Jul 08 8:50 AM
|
Originally posted by Belinda Zenk
I have a datagrid with the multi select property checked but when I try to loop through the selected items it only returns those visible at the time the command is fired.
example 1: The data grid has 100 records in it and I 'select' the first 50 (but only 20 are visible at any one time on the screen with out scrolling) but datagrid.selection.count only returns 20...???
example 2: The data grid has 100 records in it and 'Select' every 10th item for 10 total (only 2 are visible on the grid at a time with out scrolling) but datagrid.selection.count only returns 2
What am I doing wrong?
Thanks in advance! |
|
Enable "Sortable"... this forces ALL records to load into memory  Otherwise, it just "pages".... -- RJLedger - rjlSystems "... Customer First .." |
|
|
| |
| |
| |
| |
|