In fact we can use numberOfRowsLoaded on a linked form data source; however, it shows the number of those cached only.
So, if you are editing row number 28, for example, and then call ExecuteQuery() on the data source, you will probably get a lower number of rows loaded in the grid yet, say, 19.
In order to get the right number, you should use the aforementioned method together with allRowsLoaded() one.
So, if you are editing row number 28, for example, and then call ExecuteQuery() on the data source, you will probably get a lower number of rows loaded in the grid yet, say, 19.
In order to get the right number, you should use the aforementioned method together with allRowsLoaded() one.
public int wblNumberOfRowsLoaded() { int wblNumOfRec; int wblCounter; wblNumOfRec = PSAActivityEstimates_DS.numberOfRowsLoaded(); // nothing to load yet if(!wblNumOfRec) { return wblNumOfRec; } // so far we numbered those lines cached only while(!PSAActivityEstimates_DS.allRowsLoaded()) { // so let's move it on until the end of loading PSAActivityEstimates_DS.setPosition(wblNumOfRec); PSAActivityEstimates_DS.getNext(); // just to avoid never ending adventure if(wblCounter>1000) { break; } wblCounter++; // get the number for the next iteration wblNumOfRec = PSAActivityEstimates_DS.numberOfRowsLoaded(); } // now all numberOfRowsLoaded() calls will return the correct number of rows in grids wblNumOfRec = PSAActivityEstimates_DS.numberOfRowsLoaded(); return wblNumOfRec; }
No comments:
Post a Comment