on 10-04-2005 5:08 AM
Hi,
Which one is a better way to loop in a martix?
oMatrix.VisualRowCount Or oMatrix.RowCount
I see that when i delete some rows in a mtrix by right clicking on the row and select Remove, the RowCount value still show the old value(that means including the deleted row) but VisualRowCount shows the correct no of rows (excluding the deleted rows)
Can VisualRowCount property be used insted of RowCount property?
Thanks,
Satish.
That depends, if you delete the records directly if you click "delete row", (so not only from the matrix, but also from db) then you must use <i>VisualRowcount</i>, because the other records don't longer exist.
However, when you do it nice, the SBO way, you just hide the records you want to delete, and loop the matrix with <i>RowCount</i> and delete the hidden rows when the user clicks Update/Ok...
I always go for the last way, because that's the way SBO uses it... (the users are familiar with it) Also, when a user presses "Cancel/Abort", with the first method, you have a little problem because you already deleted the rows from db. With option two there is nothing to worry about, just close the form...
Hope it helps...
Grtz, Rowdy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martin,
The easiest way is to capture the <i>delete row event</i> and save the rownumber (or some value from it, i.e. the codefield). Later, when you get the validate event or the user clicks the validate/update button, you can handle the real deletion from the database, just use the saved row. If you want to delete more then one row, you can use a array...
Good luck!
Grtz, Rowdy
True, Crtl-K fires this MenuEvent. But how do you know which line is selected?
The line can be selected, or not (No line is selected).
To reproduce is, just set the cursor on a line. The line is not selected, but you can press Ctrl-K. The MenuEvent is fired, but... Which line you must delete.
On the other hand, Ctrl-K KeyPress CAN´T be catch. We havent succed on it, and there are some other posts on the forum about it.
So, I guess there is a "out of control" piece of the app. We have develop another approach to solve this, removing values which index are higher than the matrix VisualRowCount.
Any comment is welcome
Regards,
Ibai Peñ
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.