jlistview lazarus / 43-Android ---------------------------------------------------------------------- magleft · 2022-03-08 07:42 Hello. Does anyone know how we could define the situation of jlistview as read-only? I wish sometimes the selected one could not be changed a selected item. Thanks. ---------------------------------------------------------------------- Michael Collier · 2022-03-09 05:15 Hi, If you mean by read-only that a different item cannot be selected (I believe the grid text is already read-only?) - Have you tried handling the OnClickItem event to force a particular item to be selected? This works for me.. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TAndroidModule1.ListView1ClickItem(  Sender     : TObject; itemIndex  : integer; itemCaption: string) ;const k_always_selected = 1 ; // items 0..2 , always keep item 1 selectedbegin  ListView1.SetSelection( k_always_selected );end; ---------------------------------------------------------------------- magleft · 2022-03-09 08:19 Thank you for your answer. It helped a lot. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TAndroidModule1.ListView1ClickItem(  Sender     : TObject; itemIndex  : integer; itemCaption: string) ;const k_always_selected = 1 ; // items 0..2 , always keep item 1 selectedbegin      // I define two variables that take values from other parts of the code.     //  Fastat determines whether the selected item can be changed and     //  curindex is the value of the item       if fastat =-1 then      Begin         jListView1.SetItemChecked(itemIndex,False);         jListView1.SetItemChecked(curindex ,False);      end;          end;