Highlight a listview row on a short click

CidTek

Active Member
Licensed User
Longtime User
I have a Listview that is actionable on a row only with the ItemLongClick. I would like to use the standard click event to highlight the row. I was hoping that SetSelection would do that but all I get is a flash and a click sound.

Any ideas?
 

mangojack

Expert
Licensed User
Longtime User
CidTek .. currently using CustomListView and doing exactly that ..
B4X:
Sub ColorRow

   'This CustomListview Row / Panel contains 6 Labels
   Dim pnl As Panel
   pnl = clv1.GetPanel(clickedRow)
   
   'you can just reset the panels backcolor
   pnl.Color = Colors.Blue
   
      
   'OR set the individual labels backcolor and textcolor ..      
   For  i = 1 To 6   
      Dim lbl As Label
      lbl = pnl.GetView(i)
      lbl.Color = Colors.RGB(70,130,180)     'SteelBlue
      lbl.TextColor = Colors.White
   Next

End Sub

Just adding .. you will need to supply some sort of action / event to repaint the row.

Cheers mj
 
Last edited:
Upvote 0

CidTek

Active Member
Licensed User
Longtime User
@Erel - Yes, I need a row to stay highlighted so an action done from an activebar button will use the info in that LV row. Plus it gives the user visual confirmation before clicking the activebar button.

@mangojack - Is the CustomListView a drop in replacement that will work with core listview methods and properties or will I have to rework my project?
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
The CustomListView is not a drop in replacement for the ListView,there would be recoding to be done. As far as methods are concerned maybe have a look a this mListView based on native Listview. at a glance it appeared to support highlighting, but I may be wrong.

Cheers mj
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…