How can I turn off row hightling in Table Class

fdx12345

Active Member
Licensed User
Longtime User
I have switch over to the Table class which scrolls sideways as well as vertical. In that class, the individual cell in the table one selects is highlighter in one color and the row in another. Were in that table class can I comment out the coloring so the individual cell and row color is not changed?
 

fdx12345

Active Member
Licensed User
Longtime User
nothing there

Nothing to turn off in that routine and if one goes to Show and turn off background color there, I end up loosing the grid lines.
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
This might be a quick fix.. With time to spare there would be a better way. Also unsure if there is any "side effects'

B4X:
Private Sub ShowRow(row As Int)
   If visibleRows.ContainsKey(row) Then Return
   'Log("ShowRow: " & row)
   Dim lbls() As Label
   Dim values() As String
   lbls = GetLabels(row)
   values = Data.Get(row)
   visibleRows.Put(row, lbls)
   Dim rowColor() As Object
   
    'Make changes here .....
    
' If row = SelectedRow Then
      ' rowColor = SelectedDrawable
   If row Mod 2 = 0 Then
      rowColor = Drawable1
   Else
      rowColor = Drawable2
   End If
   

        For I = 0 To lbls.Length - 1
      SV.Panel.AddView(lbls(I), Header.GetView(I).Left, row * RowHeight, Header.GetView(I).Width, _
         RowHeight - 1dip)
      lbls(I).Text = values(I)
      lbls(I).Background = rowColor(I)
   Next
End Sub

Cheers mj
 
Upvote 0

fdx12345

Active Member
Licensed User
Longtime User
I looked at that route

It does take care of the background but it also erases the grid, which is not good.
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
Strange, I d/l fresh copy of table ,no other changes apart from above and still retains gridlines which to me makes sense because by scrubbing the above you are effectively doing nothing color wise to the labels within that row panel. The panel background forms the lines as the labels are spaced 1dip apart from each other so to speak.

Cheers mj
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
The easiest way to remove the cell highlight is to modify in the Table class in the innerClearAll routine line 88 from
B4X:
cd4.Initialize(0xFFFC8EAC, 0)
to
B4X:
cd4.Initialize(0xFF007FFF, 0)
This sets the selected cell color the same as the selected row color.

Best regards.
 
Upvote 0

fdx12345

Active Member
Licensed User
Longtime User
Thank you

I figured out how to change colors of individual cells in a table but the highlighting was getting in the way of viewing the results.
 
Upvote 0
Top