TValueListEditor wont accept new Elements ... lazarus / 21-General ---------------------------------------------------------------------- paule32 · 2025-03-16 19:13 Hello, with the given (voodoo) Code, I get a key Exception. But why ? - I add a Elemente, and search for it... - arow is an output variable... - I add a showmessage, to cycle stop and halt the execution of Code to react... The goal is it to add a category. 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   with ValueListEditor1 do  begin    // Kategorie als Trennzeile hinzufügen  Strings.Add('[Persönliche Daten]');    showmessage('VooDoo');    FindRow ('[Persönliche Daten]', arow);    if arow <> -1 then    ItemProps[  '[Persönliche Daten]'].ReadOnly := True;     // Normale Key-Value-Paare    Strings.Add('Name=Max Mustermann');    Strings.Add('Alter=30');  end; ---------------------------------------------------------------------- Bart · 2025-03-16 21:47 You must check the value of FindRow: in your case it will return False. I adapted your code a little in my test suite for TValueListEditor: 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 TForm1.Button13Click(Sender: TObject);var  R: Integer;  FR: Boolean;begin  with ValEd do //it's the name of my TValueListEditor  begin    ValEd.Clean;    // Kategorie als Trennzeile hinzufügen    Strings.Add('[Persönliche Daten]');    //showmessage('VooDoo');    FR := FindRow ('[Persönliche Daten]', R);    writeln('FindRow=',FR);    if FR then writeln('R=',R);    if FR and (R <> -1) then    ItemProps[  '[Persönliche Daten]'].ReadOnly := True;     // Normale Key-Value- Paare    Strings.Add('Name=Max Mustermann');    Strings.Add('Alter=30');  end;end; It outputs: FindRow=FALSE. The ValEd shows: [Persönliche Daten]NameMax MustermannAlter30 Bart ---------------------------------------------------------------------- Bart · 2025-03-17 22:10 FindRow searches for Key's. Strings.Add('[Persönliche Daten]') will add a row with an empty Key and Value being '[Persönliche Daten]'. You can either do Strings.Add('[Persönliche Daten]=')  (looks a bit awkward) or use ValueListEditor.Cells[0, Arow] := '[Persönliche Daten]' This will set the Key to '[Persönliche Daten]' with an empty value. After that FindRow will succeed, as will teh rest of the code (setting ReadOnly). Bart ---------------------------------------------------------------------- paule32 · 2025-03-18 18:04 Hello Bart, Thank you for the Informations. I found a better way with TStringGrid. If you would like, you can give me Feedback by this Project: https://github.com/paule32/FreePascal