Jump to content


Photo

Display and Edit a memo field in a DBGrid

DBgrid Memo

  • Please log in to reply
3 replies to this topic

#1 stevewong

stevewong

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 16 November 2017 - 01:11 PM

Hi,
 
I would like to display/edit a memo field in a unidbgrid, my code is as below :
 
  ClientDataSet1.FieldDefs.Add('Remark', ftmemo,200 );
  ClientDataSet1.CreateDataSet;
  Clientdataset1.Close;
  AField := clientdataset1.FieldDefs[0].CreateField(clientdataset1);
 
 ClientDataSet1.Active := True;
  ClientDataSet1.AppendRecord(['line1, line2... in memo']);
 
My problem is : if displaymemo = false then the DBgrid will show the word (memo) within the cell.
 
if set set displaymemo := true, I can see the memo content but I was not able to edit it. Is there a way when I click on the cell, a memo box will come out so that i can edit the text inside ?
 
I then try to set unidbgrid1.Columns[0].Editor := unimemo1 and was also failed. What should I do, please help !
 
Regards,
Steve

  • 0

#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4540 posts

Posted 16 November 2017 - 01:17 PM

Hi,

I then try to set unidbgrid1.Columns[0].Editor := unimemo1 and was also failed.

What problem do you have?
  • 0

#3 stevewong

stevewong

    Newbie

  • uniGUI Subscriber
  • Pip
  • 7 posts

Posted 18 November 2017 - 04:02 AM

I just want to show a memo box when I click on one of the cell under the remark column. At present DBGrid show the text and did not allow me to edit.

 

Attached File  uni-memo.png   2.08KB   7 downloads


  • 0

#4 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 10137 posts

Posted 19 November 2017 - 02:27 PM

Please see our grid editor demo.

UniMemo1 must be placed on a TUniHiddenPanel component.

It also should be created at design time or in OnCreate event of the Owner form.


  • 0





Also tagged with one or more of these keywords: DBgrid, Memo

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users