Recent

Author Topic: send string listbox >> DBgrid >>>DBedit  (Read 1448 times)

zaspany

  • Newbie
  • Posts: 2
send string listbox >> DBgrid >>>DBedit
« on: December 29, 2018, 07:33:50 pm »
Hello
How send text from listbox to DBgrid  >>>DBedit
I try

dbedit1.text :=ListBox1.Items.Strings[ListBox1.ItemIndex];

but when I click dbedit1 is clear.

2 question
how send data from dbedit1 enter key? #13

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: send string listbox >> DBgrid >>>DBedit
« Reply #1 on: December 29, 2018, 07:39:55 pm »
I try
dbedit1.text :=ListBox1.Items.Strings[ListBox1.ItemIndex];
but when I click dbedit1 is clear.

If DBEdit is connected to a dataset you must set the dataset in edit mode before attempting to change it.

Quote
2 question
how send data from dbedit1 enter key? #13

Use any of OnKeyDown/OnKeyUp/OnKeyPress events.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

zaspany

  • Newbie
  • Posts: 2
Re: send string listbox >> DBgrid >>>DBedit
« Reply #2 on: December 30, 2018, 10:25:06 am »
I use:

procedure TForm1.ListBox1Click(Sender: TObject);

 dbedit1.DataSource.DataSet.Edit;
 dbedit1.text :=ListBox1.Items.Strings[ListBox1.ItemIndex];
 dbedit1.DataSource.DataSet.Post;   

End;

And work:)

 

TinyPortal © 2005-2018