cancel
Showing results for 
Search instead for 
Did you mean: 

Matrix VisualRowCount Vs RowCount property

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

How do you know witch are the deleted rows, to delete them from the dbdatasource or database?

thanks in davance

Former Member
0 Kudos

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

Former Member
0 Kudos

The problem with this aproach is that you can´t capture Ctrl + K key press event. And this does the same as Delete Row MenuEvent.

Have you fix this issue?

Regards,

Ibai Peñ

Former Member
0 Kudos

You can catch this key event, and check if there is any row selected. Is there a row selected, then mark it for deletion...

Grtz, Rowdy

AdKerremans
Active Contributor
0 Kudos

Crtl-K is a menu event "1283"

But how to tell if a row is hidden.

Greetings

Ad

Former Member
0 Kudos

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ñ

Answers (0)