on 05-19-2010 11:13 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please bind ur matrix # colum to LineID of the row table
By
Firos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
Try the tMatrix.VisualRowCount property instead of tMatrix.RowCount
Regards,
J
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
User | Count |
---|---|
94 | |
11 | |
11 | |
6 | |
6 | |
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.