Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to implement this kind of color banding?

Hi, everybody

We are working on a SDK add-on, and are using Visual Basic.NET.

We have generated a grid which derives its data from a Query.

We want to colour the rows (in a special way) to facilitate reading the data on the grid.

Please see the picture.

Anybody has an idea how to implement this kind of colour banding?

Thanks

Leon Lai & Team

replied

Hi Leon,

Roughly :

Dim LastColour as String = Red

Dim LastITRef as String = ""

For i as integer  = 0 to oGrid.Rows.Count -1

     Dim CurrentRowITRef as String = oGrid.DataTable.Rows.GetValue("col", oGrid.GetDataTableRowIndex(i)).ToString.Trim

     If LastITRef = CurrentRowITRef then

          'Set Current Row to LastColur.

     Else

          If LastColur = Red Then

               'Your code to set Current Row as Blue here


                 LastColour = 'Blue'        

          Else

               'Your code to set Current Row as Red here

               LastColour = 'Red'

          End If

          LastITRef = CurrentRowITRef

        

     End If

Next

Regards

Edy

1 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question