I need to access, from code, all values in all cells in all rows, as currently shown in the grid (i.e., in the column order as currently shown). How the heck do I do that?
2009.1 has this. Works like a charm.
That would be awesome. My hack works, but the walking-through-20-columns-just-to-get-the-order part takes +- 10 seconds.
I believe the next hotfix (I don't believe its in the current hotfix) exposes an ActualPosition property which returns the current Row/Column offset indicating where the cell exists within the row. You can use that to find the positions of the cells for a given field layout.
That works (thank you)..... but it is way way way way way too SLOOOOOWWWW.
What I wound up doing is using the Tag of the Field to identify where in the backing object it is bound to, then issuing a DataPresenterCommands.CellFirstOverall, then loop CellRight, building a list of identifiers in-order, and THEN going to the backing object with that identifier list.
And even only navigating a single row takes multiple seconds. Very, very, very slow.
Hello,
Good point. You can once again use DataPresenterCommands for the cells.
DataPresenterCommands.CellFirstDisplayed will get the first cell.
Then knowing how many cells you have total in the record, you can call
DataPresenterCommands.CellNext as many times as the cells are and then call the DataPresenterCommand for the next Record.
Alex.
Post Scriptum: If it is applicable in your scenario, you can use only Cell Commands (from CellFirstDisplayed to CellLastDisplayed, avoid changing records) and save their values in the clipboard/file. Knowing the number of cells in one record will make it to reverse the process.