1

In the lazarus (and also delphi probably) documentation about grids, we can find the next description for the InsertRow function:

Function InsertRow
    Inserts a row in the grid and sets
    the Key-Value pair. Returns the
    index of the newly inserted row.

What is this key-value pair?

hdrz
  • 461
  • 6
  • 12
  • As you can see at the link you provided, this function related to the TValueListEditor, something like object inspector in the IDE but much simpler. "Key-Value pair" is same to [TStrings Name-Value feature](http://lazarus-ccr.sourceforge.net/docs/rtl/classes/tstrings.values.html) – Abelisto May 10 '15 at 08:21
  • @Abelisto - ok, so a key=value pair is added to the grid line? or to line collection of the grid? And what are the key and the value? – hdrz May 10 '15 at 10:08

1 Answers1

1

This is related to the TValueListEditor, and not grids in general. The TValueListEditor is similar in appearance to the Delphi Object Inspector. For brevity, I'll refer to it as VLE in the text below.

TValueListEditor.InsertRow takes three parameters:

function InsertRow(const KeyName: string; const Value: string; 
  Append: Boolean): Integer;

The keyname parameter is the name of the key (the left column of the VLE). Value is the key value (the right column of the VLE). This is stored in the same manner as the TStrings key=value pairs in the Strings property. For instance, calling it using InsertRow('Testing', '123', False) would store Testing=123.

Append merely controls whether the new entry is added before or after any already selected item in the VLE. If the VLE is empty, it has no effect.

For more information, see the Delphi VCL help

Ken White
  • 123,280
  • 14
  • 225
  • 444