Skip to Content
avatar image
Former Member

Highlight row in User Matrix

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 24, 2014 at 08:29 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 24, 2014 at 08:38 AM

    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

    Add comment
    10|10000 characters needed characters exceeded