on 09-15-2011 6:07 AM
Experts,
For Add row in matrix I have written
Case "AddRow"
Try
Dim omatrix As SAPbouiCOM.Matrix
omatrix = objform.Items.Item("mtx_0").Specific
If omatrix.RowCount > 0 Then
Dim rows As Integer = omatrix.RowCount
For i As Integer = 1 To rows
If omatrix.IsRowSelected(i) = True Then
Dim result As Integer
result = result = SBO_Appln.MessageBox("Do You Want to Add Row", 1, "Yes", "Cancel")
If result = 1 Then
omatrix.AddRow()
objform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
Exit For
End If
End If
Next
End If
Catch ex As Exception
End Try
But it is not working. Please help. And how to have same feel like Std B1 where if we add row anywhere in matrix, it will take the exact row numbers and also we can add row anywhere in between not only for last row
Hi,
Try This.......
Try
Dim omatrix As SAPbouiCOM.Matrix
omatrix = objform.Items.Item("mtx_0").Specific
If omatrix.RowCount > 0 Then
Dim rows As Integer = omatrix.RowCount
For i As Integer = 1 To rows
If omatrix.IsRowSelected(i) = True Then
Dim result As Integer
result = SBO_Appln.MessageBox("Do You Want to Add This Row", 1, "Yes", "Cancel")
If result = 1 Then
omatrix.AddRow(1, pVal.Row + 1)
objform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
Exit For
End If
End If
Next
End If
Thanks
Shafi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For Adding a row
Try This.....
case "AddRow"
omatrix.AddRow(1)
Thanks
Shafi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try
Dim omatrix As SAPbouiCOM.Matrix
omatrix = objform.Items.Item("mtx_0").Specific
If omatrix.RowCount > 0 Then
Dim rows As Integer = omatrix.RowCount
For i As Integer = 1 To rows
If omatrix.IsRowSelected(i) = True Then
Dim result As Integer
result = SBO_Appln.MessageBox("Do You Want to Delete This Row", 1, "Yes", "Cancel")
If result = 1 Then
omatrix.AddRow()
objform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
Exit For
End If
End If
Next
End If
Catch ex As Exception
End Try
If i use this, then if i select last row and give add row, it is showing the last row's content only. But for add row, in std
only blank row comes. And if i do add row in between (not in last row) or after first row, it adds last tow only copying last row's content
Try
Dim omatrix As SAPbouiCOM.Matrix
omatrix = objform.Items.Item("mtx_0").Specific
If omatrix.RowCount > 0 Then
Dim rows As Integer = omatrix.RowCount
For i As Integer = 1 To rows
If omatrix.IsRowSelected(i) = True Then
Dim result As Integer
result = SBO_Appln.MessageBox("Do You Want to Add This Row", 1, "Yes", "Cancel")
If result = 1 Then
omatrix.AddRow(1, i + 1)
objform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
Exit For
End If
End If
Next
End If
Catch ex As Exception
End Try
this not working properly....
Hi
Try
Dim omatrix As SAPbouiCOM.Matrix
omatrix = objform.Items.Item("mtx_0").Specific
If omatrix.RowCount > 0 Then
Dim rows As Integer = omatrix.RowCount
For i As Integer = 1 To rows
If omatrix.IsRowSelected(i) = True Then
Dim result As Integer
result = SBO_Appln.MessageBox("Do You Want to Add This Row", 1, "Yes", "Cancel")
If result = 1 Then
omatrix.AddRow(1, i + 1)
objform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
Exit For
End If
End If
Next
End If
Catch ex As Exception
End Try
Regards
Arun
Try
Dim omatrix As SAPbouiCOM.Matrix
omatrix = objform.Items.Item("mtx_0").Specific
If omatrix.RowCount > 0 Then
Dim rows As Integer = omatrix.RowCount
For i As Integer = 1 To rows
If omatrix.IsRowSelected(i) = True Then
Dim result As Integer
result = SBO_Appln.MessageBox("Do You Want to Add This Row", 1, "Yes", "Cancel")
If result = 1 Then
omatrix.AddRow(1, i)
objform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
Exit For
End If
End If
Next
End If
With objform.DataSources.DBDataSources.Item("@CYCLE")
.Clear()
omatrix.FlushToDataSource()
For iRow As Integer = 0 To omatrix.RowCount - 1
.SetValue("LineId", iRow, (iRow + 1).ToString) 'U_RowNo is the db field binded with your row no column
Next
End With
omatrix.LoadFromDataSource()
Catch ex As Exception
End Try
omatrix.AddRow(1, i) is giving correct value instead of omatrix.AddRow(1, i+1) which is a bit strange anywez...
But blank row is not coming, instead of that last row values coming
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
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.