Skip to Content
avatar image
Former Member

Matrix

Hi

   I am displaying data in a matrix . I want the color of row should change on which row user clicked.

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Dec 22, 2014 at 09:08 AM

    HI.

    YOU CAN USE DOUBLE CLICK EVENT

    TRY

    ''    If (pVal.BeforeAction = TRUE And pVal.ITEMUID = "YOURMATRIXUID" AND PVAL.FORMUID="YOURFORMUID") Then

    IF PVAL.COLUID="YOURMATRIXCOLUMNUID" THEN

    --EXAMPLES PVAL.COLUID ="V-_1"  FOR FIRST COLUMN #

      ''            omatrix = oForm.Items.Item("MATRIXUID").Specific

            ''            For i As Integer = 1 To omatrix.VISUALROWCOUNT

            ''                If (omatrix.IsRowSelected(i) = True) Then

                              omatrix.CommonSetting.SetCellBackColor(i, 10, -7)

                                      I= ROW AND 10 IS COLUMN -7 IS RGB COLOR

            ''         

                               END IF

                                     END IF

    END IF

    REFER NET FOR RGB COLOR CODES..

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi

         I have written the below code but it is not going in - If (oMatrix.IsRowSelected(i) = True) Then condition

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

                  Try

                      If pVal.ColUID = "Code" Then

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

                          For i As Integer = 1 To oMatrix.VisualRowCount

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

                                  MessageBox.Show(i)

                                  oMatrix.CommonSetting.SetCellBackColor(i, 10, -7)

                              End If

                          Next

                      End If

                  Catch ex As Exception

                      SBO_Application.MessageBox(ex.Message)

                  End Try

              End If

      Thanks

  • avatar image
    Former Member
    Dec 24, 2014 at 03:17 AM

    Hi,

    Try this..

       Dim oGridSetting As SAPbouiCOM.CommonSetting = Me.m_Grid.CommonSetting

                For i As Integer = 2 To Me.m_Grid.DataTable.Rows.Count Step 2

                    oGridSetting.SetRowBackColor(i, CONSTANTS.ROW_BACKGROUND_GRAY)

                Next i

    Regards,

    Prasad

    Add comment
    10|10000 characters needed characters exceeded