OK, knowers of arcane and esoteric stuffs, here's your challenge: I have a presentation framework data grid, and I'm trying to make an ancient ADO recordset it's datasource. I'm trying now, because after months of working, it magically stopped working after somebody fiddled with the code, but I can't for the life of me figure out what they set wrong.
I've checked the structure and contents of the recordset 6 ways from Sunday, and I'm absolutely certain it contains a large amount of data, but when I set it as the datasource for the grid, the grid updates column names, but doesn't show any data!
I've rewritten the code three different ways now, and it's always the same failure.
Got any thoughts, "The Internet"?
Plan-A̵̛͈̬̥̿͋̓͛̕
in reply to Blaise • — (0.0.0.0/ 0) •@Blaise This is the most common cause. If the code iterating through or preparing the recordset left the cursor at the end (EOF), the DataGrid binds to the current position forward. Since there are no records "ahead" of EOF, it renders zero rows but retains the schema (column names).
Fix is explicitly reset the cursor to the beginning before assigning the datasource.
1.Reset cursor to the first record
2.Assign the datasource which is rs
3.Force a refresh if the grid doesn't auto-update
3 separate commands
The End if is not there for a joy