cancel
Showing results for 
Search instead for 
Did you mean: 

Matrix - Help with setting 1st column for line numbers

Former Member
0 Kudos

Hi,

I have created a matrix on a custom form and would like to add line numbers to the # column line that of the quotation screen.

The matrix itself is populated correct from the Query and LoadFromDataSource, and all the fields and columns are filled in correctly, the only column I am having trouble with is the 1st one for line numbers. My code for adding the line numbers is


SBO_Application.MessageBox("Matrix Count: " & tMatrix.RowCount)
For i = 1 To tMatrix.RowCount
      oEditText = tColumns.Item("#").Cells.Item(i).Specific
      oEditText.Value = i
Next

For the example I am using I get the message box appear:

Matrix Count: 26

So I know I should have the line number go from 1 to 26, however I only get 1 to 9 displayed, all the remaining lines are blank.

Any ideas on why it stops at 9 or what I should do to correctly set the line numbers in the Number column like that of the system Quotation/Sales orders forms.

Your help is much appreciated

Matthew

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member458725
Active Participant
0 Kudos

Try This....


for(int i=1;i<=oMatrix.Count;i++)
{
   oEdit = (SAPbouiCOM.EditText)oMatrix.Columns.Item("V_-1").Cells.Item(i).Specific;
   oEdit.Value=i.ToString();
}

Vibin Varghese

Former Member
0 Kudos

Hi,

Please bind ur matrix # colum to LineID of the row table

By

Firos

Former Member
0 Kudos

Hello

Try the tMatrix.VisualRowCount property instead of tMatrix.RowCount

Regards,

J

Former Member
0 Kudos

Hi,

I tried changing it to the following as you suggested:


SBO_Application.MessageBox("Matrix Count: " & tMatrix.VisualRowCount)
For i = 1 To tMatrix.VisualRowCount
    oEditText = tColumns.Item("#").Cells.Item(i).Specific
    oEditText.Value = i
Next

The message box still displays 26, however my lines still only go up to number 9.

Thanks for the quick response.

Former Member
0 Kudos

Dear Matthew,

As you are filling up ur matrix using an SQL query, I guess u can use the ROW_NUMBER() function in the SQL statement itself and get the row nos in the Query result.

Check the following link for more information.

http://www.openwinforms.com/row_number_to_sql_select.html

Hope it helps,

Vasu Natari.

Former Member
0 Kudos

Hi,

Unfortunately its being filled as a condition i.e:

Dim oConditions As SAPbouiCOM.Conditions

Dim oCondition As SAPbouiCOM.Condition

tDBDataSource.Query(oConditions)

Can i just replace the oConditions with the equivalent statement in SQL?

Many Thanks