Bart,
Many thanks for your reply, it's starting to make sense now :)
It is possible to make the "key" column read only?

Richard


On 15 December 2013 14:59, Bart <[email protected]> wrote:

> Hi,
>
> > Please could someone give me an example of how to programmatically add
> column and then
> > items into a TValueListEditor?
>
> You cannot (maybe you can, but you really should NOT) add colums to
> TValueListEditor.
> It will always have exactly 2 colums by design.
>
> Adding items isn't that hard.
>
> The easiest way is to add the Key/Value pair to the Strings property:
>
> ValEdit.Strings.Add('MyValue=AValue');
>
> If you want you can hav teh Value column for this item behave like a
> dropdownlist:
>
>   with ValEdit.ItemProps['MyValue'] do
>   begin
>     KeyDesc := 'MyValue: PickList';  //optional description
>     EditStyle := esPickList;
>     ReadOnly := True;  //user cannot add options to dropdownlist
>     PickList.Add('AValue');
>     PickList.Add('AnotherValue');
>   end;
>
> Bart
>
> --
> _______________________________________________
> Lazarus mailing list
> [email protected]
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to