Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6347325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:11:32+00:00 2026-05-24T21:11:32+00:00

I have a table in DB with information about some goods. Goods may be

  • 0

I have a table in DB with information about some goods. Goods may be fillable, so we can add text to it. So I want to dynamically generate a list of checkboxes related to info in table and even some checkboxes must be with TEdit component to make a possibility to add text to this item. So how can I do it? What component should I use? I figure out that TTreeView is almost enough, but it doesn’t allow to “draw” TEdit near checkboxes. I’m using Delphi 2010. Thanks in advance! Hope for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:11:34+00:00Added an answer on May 24, 2026 at 9:11 pm

    If I read your question correctly, you would like to create some controls on a form based on the contents of table. In the following example I have assumed you want to do this based on the contents of the current record in a TDBGrid, so you’ll have to adapt as needed.

    The example assumes a form with a TDBGrid and a TPanel (Panel1) that will hold the controls created at run time.

    The TDBGrid will be connected to a TDataSource component and that will be connected to some TDataSet descendant for the table/query with the information. The TDataSource has a OnDataChanged event. This event gets triggered when the data in a field changes or when the current record in the dataset changes. So you can use that to change the controls as the current record changes.

    procedure TForm1.DataSource1DataChange(Sender: TObject; Field: TField);
    var
      i: Integer;
      Chk: TCheckBox;
      Edit: TEdit;
    begin
      // When the Field is assigned, the call is the result of a change in the field.
      // When the Field is unassigned, the call is the result of changing the current record.
      if Assigned(Field) then
        Exit;
    
      // Remove controls on panel
      for i := Panel1.ControlCount - 1 downto 0 do
        Panel1.Controls[i].Free;
    
      // Add controls on panel for current record
      if True then      // Replace this with condition based on contents of current record (if any!)
      begin
        Chk := TCheckBox.Create(Self);  // Set Owner, so it is freed when form is closed.
        Chk.Parent := Panel1;           // Set Parent, so the control is shown.
        Chk.Left := FLeftIndent;        // Create FLeftIndent as a member field of the form, set value in OnCreate.
        Chk.Top := FNextTop;            // Create FNextTop as a member field of the form.
        Inc(FNextTop, FSpacing);        // Create FSpacing as a member field of the form, set value in OnCreate.
    
        if True then    // Replace this with condition that dictates creation of Edit
        begin
          Edit := TEdit.Create(Self);
          Edit.Parent := Panel1;
          Edit.Left := Chk.Left + Chk.Width + FSpacing;
          Edit.Top := Chk.Top;          // Add offset as needed for proper alignment of CheckBox and Edit.
        end;
      end;
    end;
    

    Please note that if you do not have any other checkboxes or edits on the form, you will have to include the proper vcl units yourself. The easiest way to do that is to drop them on the form, save the form and then delete the controls again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that holds information about cities in a game, you can
Say I have at database table containing information about a news article in each
Greetings friends, In my MySQL database, I have 'MAB' table which contains information about
I have a table in which users store scores and other information about said
I have two tables: a schedule table that contains information about how an employee
I have a table of product information with many bit columns. This table can
Here's the situation I'm in. I have a table containing peoples' information. Some of
Suppose I have two tables: Table A has information about the stock holdings of
I have a table named Annonce that contains some informations about a post ;
I have a table that currently is a long list of devices and information

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.