En Mon, 08 Jun 2015 06:03:28 -0500, Koenraad Lelong <[email protected]> escribió:
So you want the picklist only in the first row. Then use something like:

// use grid's OnSelectEditor
procedure TForm1.StringGrid1SelectEditor(Sender: TObject; aCol, aRow:
Integer;
   var Editor: TWinControl);
begin
   if aRow=StringGrid1.fixedRows then begin
     Editor := StringGrid1.EditorByStyle(cbsPickList);
     // fill the picklist with field list
     TPickListCellEditor(Editor).Items.CommaText :=
'Field1,Field2,Field3,etc';
     // or TPickListCellEditor(Editor).Items.Assign(FieldList)
     // or etc
   end else
Editor := nil; // readonly the rest of rows (or select another editor)
end;
Hi,

It's almost what I want. Your code makes the second row behave like a picklist (1 fixed row : row #0 is fixed), so I subtracted 1 from StringGrid1.fixedRows but no luck ;-)I tried a few things, but I can't let the cells of the fixed row to behave like a picklist. Am I still missing something ?

Anyway, thanks very much already.


Can't you set FixedRows:=0?, if you do that what problems do you see in your program?

Jesus Reyes A.


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to