Help designing questionnaire design lazarus / 31-LCL ---------------------------------------------------------------------- Leledumbo · 2010-03-12 08:50 I'd like to create a questionnaire, more or less is like in the attached image. Currently it uses nested panels, but I think it's just too much. It would be better if I can use T*Grid but I have no idea how to put the radio button panel as a cell in the grid. Can anyone help me? Or is there any better approach? A code snippet to add a row would be helpful (so that questions can be dynamically added). ---------------------------------------------------------------------- marcov · 2010-03-12 09:03 Have a look at the "advanced" demo of Virtual String Tree. There is a tab that is an example how to use VST as a grid, and another that is an example how to nest a checkbox in a stringtree. Combined it gives a grid with "other" widget functionality. I use it in my production app at work, it is stable, though has minor visual artefacts. ---------------------------------------------------------------------- Leledumbo · 2010-03-12 09:42 Where exactly is that? I can't find it in my installation. Is it a 3rd party package? ---------------------------------------------------------------------- theo · 2010-03-12 09:55 Quote from: Leledumbo on March 12, 2010, 10:42:40 amWhere exactly is that? I can't find it in my installation. Is it a 3rd party package? http://forum.lazarus.freepascal.org/index.php/topic,8601.0.html Home of the original delphi version: http://www.soft- gems.net/index.php?option=com_content&task=view&id=12&Itemid=33 ---------------------------------------------------------------------- davesimplewear · 2010-03-17 21:50 the following code taken from lazarus/examples/grids/gridcelleditor relates to what you want to insert a radio button in a string grid, substitute the radio button for the combobox. Code: [Select]procedure TForm1.StringGrid1SelectEditor(Sender: TObject; aCol, aRow: Integer;   var Editor: TWinControl); begin   if (aCol=3) and (aRow>0) then begin     ComboBox1.BoundsRect:=StringGrid1.CellRect(aCol,aRow);     ComboBox1.Text:=StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row];     Editor:=ComboBox1;   end; end; Regards Dave ---------------------------------------------------------------------- Leledumbo · 2010-03-18 05:40 Quotethe following code taken from lazarus/examples/grids/gridcelleditor relates to what you want to insert a radio button in a string grid, substitute the radio button for the combobox. Doesn't it get called only when I click the cell? I mean, when viewed normally, the radio is not shown. ---------------------------------------------------------------------- davesimplewear · 2010-03-18 06:17 yes, you are correct, sorry, did not think of that. Regards Dave ---------------------------------------------------------------------- davesimplewear · 2010-03-20 00:27 Have you had a look at Orpheus controls, they have a table component with check box that may do what you are after. Regards Dave ---------------------------------------------------------------------- jesusr · 2010-03-20 01:48 in r24105 I have improved the support in checkbox column a little, find attached a sample project.