Jump to content


Photo

NxDBGrid.BestFitRow(i) doesn't seem to work.


  • Please log in to reply
3 replies to this topic

#1 FourWhey

FourWhey
  • Members
  • 165 posts

Posted 16 March 2016 - 06:35 PM

ADOQuery1.Open;
NxDBGrid.BeginUpdate();
for i := 0 to NxDBGrid.RowCount -1 do
  NxDBGrid.BestFitRow(i);
NxDBGrid.EndUpdate();

If I step into the code, I see that it's setting a BestHeight based on the max height of the tallest cell within the row, but once it's done running it doesn't adjust the height of that row.

 

If I try and set NxDBGrid.RowHeight[0] := 36 directly, I get an internal error in D7 with update 1. However, using a NxGrid rather than NxDBGrid this works fine.

 

[Fatal Error] Test.pas(416): Internal error: E5912

 

I'd really like to use the Databound control.

 

Any ideas?



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 17 March 2016 - 09:58 PM

Hi FourWhey,

Please sorry for delay, working hard.

Version 5 doesn't save RowHeights. Simply it doesn't have where. OnChangeRowHeight is called and row height need to be manually stored. Then OnMeasuringRowHeight is used for taking this value back.

In v6 I have solved this with using bookmarks. If row is different from default row (selected, or row height is different than global RowHeight), bookmark is saved and inserted into list. Then, if needed it's used so developer don't need to maintain own lists.

I have worked hard last weeks on v6 and maybe your bug (reported in other thread) is now fixed? Can you please try to test it once again.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.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 FourWhey

FourWhey
  • Members
  • 165 posts

Posted 17 March 2016 - 10:08 PM

... I have worked hard last weeks on v6 and maybe your bug (reported in other thread) is now fixed? Can you please try to test it once again.

 

Okay got it, so v5 db grid just doesn't support it out of the box. I don't think I can assign a RowHeight manually anyway since I get a Delphi internal error when I try.

 

I will take another look at v6. If I can get v6 to do what I need, I will switch to it.

 

Thank you!



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 17 March 2016 - 10:13 PM

Hi,

I hope that v6 approach is the right one, maybe in v5 you can have another field reserved for height only, but not sure if this is good for all cases.

If you can, please take another look. Also follow History.txt for updates, I am updating every 2-3 days.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users