cancel
Showing results for 
Search instead for 
Did you mean: 

Highlight row in User Matrix

Former Member
0 Kudos

Dear Sir

   I have written the below code . I want instead of clicking on "#" if we click on any column in row  it should get highlight.

If (pVal.FormTypeEx = "TypeFrmMatrix" And pVal.BeforeAction = True And pVal.ItemUID = "Matrix1") Then

            Try

                If (pVal.ColUID = "#" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) Then

                    oMatrix = oForm.Items.Item("Matrix1").Specific

                    oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single

                    For i As Integer = 1 To oMatrix.RowCount

                        If (oMatrix.IsRowSelected(i) = True) Then

                            oMatrix.SelectRow(i, True, True)

                        End If

                    Next

                End If

            Catch ex As Exception

                SBO_Application.MessageBox(ex.Message)

            End Try

        End If

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sunny,

For a test, I have just used this:

if (pVal.ItemUID == enControlName.Matrix && (pVal.ColUID == "colItemCode" | pVal.ColUID == "colItemName") && pVal.EventType == BoEventTypes.et_CLICK && pVal.FormMode == 1)

  {

     SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)m_SBO_Form.Items.Item("Matrix").Specific;

     int Row = pVal.Row;

     oMatrix.SelectRow(Row, true, false);

  }

Hope it helps.

Thanks & Regards

Ankit Chauhan

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Sunny,

It looks that your code is ready to use. Just add all the ColUID for all the columns in the matrix.

This will work for you.

Hope it helps.

Thanks & Regards

Ankit Chauhan