Jump to content


Photo

Displaying Multiple Lines in a TNxMemoColumn6.


  • Please log in to reply
10 replies to this topic

#1 Speed

Speed
  • Members
  • 121 posts

Posted 23 March 2021 - 07:46 AM

Hi Boki,

 

What property or properties determine whether or not a TNxMemoColumn6 displays multiple lines in a TNextGrid6?

 

Thanks.

 

= Steve

 



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,977 posts
  • Gender:Male

Posted 23 March 2021 - 01:09 PM

Hi,

 

Wondering does MultiLineEditOptions property helps you? There is at the moment single flag there.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Speed

Speed
  • Members
  • 121 posts

Posted 24 March 2021 - 01:01 AM

Hi,

 

Wondering does MultiLineEditOptions property helps you? There is at the moment single flag there.

I'm trying to set this in code.  Is this the correct way?

var
   NewColumn: TNxColumn6;
begin
   FGrid.BeginUpdate;
   FProviders.AddObject(AProviderName, TObject(AProviderID));

   NewColumn := FGrid.Columns.Add(TNxMemoColumn6, AProviderName);
   NewColumn.AutoSize := False;
   NewColumn.DrawingOptions := [doContent,doCustom];
   NewColumn.Editing := False;
   NewColumn.OnDrawBackground := ColumnDrawBackground;
   NewColumn.Resizeable := False;
   NewColumn.VerticalAlignment := taAlignTop;
   NewColumn.Width := 240;

   NewColumn.Header.Font.Name := 'Segoe UI';
   NewColumn.Header.Font.Size := 12;
   NewColumn.Header.Font.Style := [fsBold];
   NewColumn.Header.Alignment := taCenter;
   NewColumn.Header.Color := FHeaderColour;
   NewColumn.Header.HideArrow := True;
   NewColumn.Header.Clickable := False;

   TNxMemoColumn6(NewColumn).MultiLineEditOptions := [meWordWrap];

I'm referring to the last line above.

 

Thanks.

 

= Steve

 



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,977 posts
  • Gender:Male

Posted 24 March 2021 - 10:38 AM

Hi,

 

Yes, this is ok, but you can also declare your variable at the top to be TNxMemoColumn6.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 Speed

Speed
  • Members
  • 121 posts

Posted 25 March 2021 - 03:31 AM

Hi,

 

Yes, this is ok, but you can also declare your variable at the top to be TNxMemoColumn6.

If I do that, what object do I use here: NewColumn := FGrid.Columns.Add(TNxMemoColumn6, '');



#6 Speed

Speed
  • Members
  • 121 posts

Posted 25 March 2021 - 03:35 AM

var
   NewColumn: TNxColumn6;
begin
   FGrid.BeginUpdate;
   FProviders.AddObject(AProviderName, TObject(AProviderID));

   NewColumn := FGrid.Columns.Add(TNxMemoColumn6, AProviderName);
   NewColumn.AutoSize := False;
   NewColumn.DrawingOptions := [doContent,doCustom];
   NewColumn.Editing := False;
   NewColumn.OnDrawBackground := ColumnDrawBackground;
   NewColumn.Resizeable := False;
   NewColumn.VerticalAlignment := taAlignTop;
   NewColumn.Width := 240;

   NewColumn.Header.Font.Name := 'Segoe UI';
   NewColumn.Header.Font.Size := 12;
   NewColumn.Header.Font.Style := [fsBold];
   NewColumn.Header.Alignment := taCenter;
   NewColumn.Header.Color := FHeaderColour;
   NewColumn.Header.HideArrow := True;
   NewColumn.Header.Clickable := False;

   TNxMemoColumn6(NewColumn).MultiLineEditOptions := [meWordWrap];

   FGrid.EndUpdate;
end;

For some reason, the memo field isn't resizing the row to show the contents (see attached image).  Is there anything that could prevent this from working?

 

= Steve

Attached Files



#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,977 posts
  • Gender:Male

Posted 25 March 2021 - 10:36 PM

If I do that, what object do I use here: NewColumn := FGrid.Columns.Add(TNxMemoColumn6, '');

This line is still the same.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#8 Speed

Speed
  • Members
  • 121 posts

Posted 26 March 2021 - 02:17 AM

If I do as you suggested I get an error:

var
   NewColumn: TNxMemoColumn6;
begin
   FGrid.BeginUpdate;
   FProviders.AddObject(AProviderName, TObject(AProviderID));

   NewColumn := FGrid.Columns.Add(TNxMemoColumn6, AProviderName);
   NewColumn.AutoSize := False;
   NewColumn.DrawingOptions := [doContent,doCustom];
   NewColumn.Editing := False;
   NewColumn.OnDrawBackground := ColumnDrawBackground;
   
   
   [dcc32 Error] UnitDayPlanner.pas(375): E2010 Incompatible types: 'TNxMemoColumn6' and 'TNxColumn6'

 



#9 Speed

Speed
  • Members
  • 121 posts

Posted 26 March 2021 - 02:19 AM

Anyway, the more important issue is that the memo cell doesn't expand to fit the text, even though MultiLineEditOptions is set to [meWordWrap];

 

Is there another property that could stop that from working?

 

= Steve



#10 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,977 posts
  • Gender:Male

Posted 27 March 2021 - 11:52 AM

Hi Steve,

 

You can try to set AutoFit property or use BestFitRow after the editing is finished.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#11 Speed

Speed
  • Members
  • 121 posts

Posted 29 March 2021 - 07:31 AM

Thanks you.  Using a combination of those properties I managed to get it to work.

 

= Steve






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users