on 10-26-2010 7:28 AM
hi all
Now i m able to select one record from CFL ,its working fine for one record
But while selecting multiple records ,only one record coming to matrix .and also inert one empty line in matrix.
Case "Color_mat"
Select Case pVal.ColUID
Case "txticode"
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_VALIDATE
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
Dim bonCflEvents As SAPbouiCOM.ChooseFromListEvent
Dim bonDTTable As SAPbouiCOM.DataTable
Dim bonCflList As SAPbouiCOM.ChooseFromList
Dim bnnstrUID As String
bonCflEvents = pVal
bnnstrUID = bonCflEvents.ChooseFromListUID
bonDTTable = bonCflEvents.SelectedObjects
bonCflList = lonConvForm.ChooseFromLists.Item(bnnstrUID)
If Not (bonDTTable Is Nothing) Then
If bonCflList.UniqueID = "COLITEMCFL1" Then
gonMatConvMatrix.GetLineData(pVal.Row)
lonDetailDatasource.SetValue("U_Itmcode", lonDetailDatasource.Offset, bonDTTable.GetValue(0, 0))
lonDetailDatasource.SetValue("U_ItemName", lonDetailDatasource.Offset, bonDTTable.GetValue("ItemName", 0))
gonMatConvMatrix.SetLineData(pVal.Row)
If pVal.Row = gonMatConvMatrix.VisualRowCount Then
lonDetailDatasource.SetValue("U_Itmcode", lonDetailDatasource.Offset, "")
lonDetailDatasource.SetValue("U_ItemName", lonDetailDatasource.Offset, "")
lonDetailDatasource.SetValue("U_Avail", lonDetailDatasource.Offset, "")
lonDetailDatasource.SetValue("LineId", lonDetailDatasource.Offset, pVal.Row + 1)
gonMatConvMatrix.AddRow()
gonMatConvMatrix.SetLineData(pVal.Row + 1)
gonMatConvMatrix.FlushToDataSource()
End If
Else
End If
End If
End Select
End Select
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
When you create the choose from list enable MultiSelection=true
Dim cflCreator As ChooseFromListCreationParams
cflCreator = DirectCast(oApplication.CreateObject(BoCreatableObjectType.cot_ChooseFromListCreationParams), SAPbouiCOM.ChooseFromListCreationParams)
cflCreator.UniqueID = "UID"
cflCreator. MultiSelection= True
cflCreator.ObjectType = "objectType"
then on the after choosefromlist event try the below code
Dim oDataTable As SAPbouiCOM.DataTable
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
Try
Dim str As String = ""
oCFLEvento = pVal
oDataTable = oCFLEvento.SelectedObjects
If oDataTable Is Nothing Then Exit Sub
form.DataSources.DBDataSources.Item("DBdatasource).Clear()
With form.DataSources.DBDataSources.Item("DBdatasource")
If oDataTable.Rows.Count > 0 Then
For i As Integer = 0 To oDataTable.Rows.Count - 1
.InsertRecord(i)
.SetValue("U_ItemCode", i, oDataTable.GetValue(0, i).ToString)
.SetValue("U_ItemName", i, oDataTable.GetValue(1, i).ToString)
Next
End If
End With
Dim oMatrix As SAPbouiCOM.Matrix = form.Items.Item("mtxItems").Specific
oMatrix.LoadFromDataSource()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Hope this will help you
Regards
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Try this code
Select pVal.ColUID
Case "txticode"
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_VALIDATE
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST
Dim bonCflEvents As SAPbouiCOM.ChooseFromListEvent
Dim bonDTTable As SAPbouiCOM.DataTable
Dim bonCflList As SAPbouiCOM.ChooseFromList
Dim bnnstrUID As String
bonCflEvents = pVal
bnnstrUID = bonCflEvents.ChooseFromListUID
bonDTTable = bonCflEvents.SelectedObjects
bonCflList = lonConvForm.ChooseFromLists.Item(bnnstrUID)
If Not (bonDTTable Is Nothing) Then
If bonCflList.UniqueID = "COLITEMCFL1" Then
lonDetailDatasource.Clear()
gonMatConvMatrix.FlushToDataSource()
With lonDetailDatasource
If bonDTTable.Rows.Count > 0 Then
For i As Integer = 0 To bonDTTable.Rows.Count - 1
.InsertRecord(i)
.SetValue("U_Itmcode", i, bonDTTable.GetValue(0, i).ToString)
.SetValue("U_ItemName", i, bonDTTable.GetValue(1, i).ToString)
Next
End If
End With
End If
End If
gonMatConvMatrix.LoadFromDataSource()
End Select
End Select
Regards
Arun
User | Count |
---|---|
106 | |
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.