Skip to Content
author's profile photo
Former Member

Matrix VisualRowCount Vs RowCount property

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    author's profile photo
    Former Member
    Oct 04, 2005 at 06:13 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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ñ