Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

DBAdvSmoothListBox

 Post Reply Post Reply
Author
Martin Pa View Drop Down
New Member
New Member
Avatar

Joined: 11 May 2019
Posts: 6
Post Options Post Options   Quote Martin Pa Quote  Post ReplyReply Direct Link To This Post Topic: DBAdvSmoothListBox
    Posted: 11 May 2019 at 6:50pm
Hello, 
For last 2 day I'm fighting with DBAdvSmoothListBox. Your compoenents are awsome and really widly customizeable and your examples + doc helps in 90% of issues, but no I'm not able find out, why my ListBoxes are not able to show nvarchar(max) data fields.  Only (WIDEMEMO) is shown. I know about this similar issues with TDbGrid (but I still cant handle the problem)

My config: RAD Studio 10.2, FireDAC datasets, MSSQL

What I tryed: 
implement ItemDraw method - NOK
implement onGetText method of TFIeld - NOK
Set PageMode = false - this helps but leads in lost synchronization between ListBox and dataset itself + few issues which I can handle but ... you know :)

Thanks in advice
Back to Top
Martin Pa View Drop Down
New Member
New Member
Avatar

Joined: 11 May 2019
Posts: 6
Post Options Post Options   Quote Martin Pa Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2019 at 11:39pm
Note: Of course I can change my data type in DB in order to produce simple string fields, but I would like to find out some solid solution. 

Thanks again :)
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 7686
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2019 at 12:01pm
The normal way to handle this is to implement the DB field's OnGetText event.
See also:
Back to Top
Martin Pa View Drop Down
New Member
New Member
Avatar

Joined: 11 May 2019
Posts: 6
Post Options Post Options   Quote Martin Pa Quote  Post ReplyReply Direct Link To This Post Posted: 13 May 2019 at 12:13am
Thanks for answer. 
I focused to your advice and find out that I have to assign OnGetText method in AfterDatasetOpen. 

I hope I can ask you for one additional question about ListBox. 
With PageMode = false, the scolling (with whell / drag) works well and really smooth. But with PageMode = true the scrolling and draging is "fuzzy". 
Ok when I disable drag, the scrolling works "page after page". 
Can you -please- explain for me in few words how does dragging works with pageMode = true?

Thanks in advice. 
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3199
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 13 May 2019 at 12:07pm
Hi, PageMode is a different way of presenting the data, it jumps between pages, that's why scrolling is forced to move to the next page as soon as the buffer end has been reached. You can for example set the buffercount of the dataset to a number that is twice the amount of items you are visually seeing in the listbox to smoothen the transition between pages.
Back to Top
Martin Pa View Drop Down
New Member
New Member
Avatar

Joined: 11 May 2019
Posts: 6
Post Options Post Options   Quote Martin Pa Quote  Post ReplyReply Direct Link To This Post Posted: 13 May 2019 at 12:58pm
Hi, thx. I'll try that :)
Back to Top
Martin Pa View Drop Down
New Member
New Member
Avatar

Joined: 11 May 2019
Posts: 6
Post Options Post Options   Quote Martin Pa Quote  Post ReplyReply Direct Link To This Post Posted: 16 May 2019 at 11:02am
Hi, thanks for answers.

Unfortunally yesterday we upgraded to 10.3 Rio and the issue with (WIDESTRING) apeared again. I'm almost sure that its not a TMS issue, but I hope (and please :) ) you can help me. 

when I assign OnGetText method to fields which are WideMemo dateType the handling method is not triggered :-(  
When I compile the same code in 10.2.1 it works fine ://  Thanks for help:
Code snippet follows: 

procedure TForm2.FormCreate(Sender: TObject);
begin
    query := TFDQuery.Create(self);
    query.Connection := FDConnection1;
    query.AfterOpen := myAfterOpen;
    DataSource1.DataSet := query;
    query.SQL.Add('SELECT * FROM EC_NOTIFICATIONS WHERE User = 9103');
    query.Active := True;
end;

procedure TForm2.myAfterOpen(aDataset: TDataset);
begin
    for var I := 0 to aDataset.Fields.Count-1
    do begin
       if(aDataset.Fields.DataType in [ftWideMemo, ftWideString])
       then begin
            aDataset.Fields.OnGetText := myOnGetText;
       end;
    end;
end;

procedure TForm2.myOnGetText(aSender: TField; var text: string;
  displayText: boolean);
begin
    ShowMessage('getting wide text format');
    text := aSender.asString;
end;
Back to Top
Martin Pa View Drop Down
New Member
New Member
Avatar

Joined: 11 May 2019
Posts: 6
Post Options Post Options   Quote Martin Pa Quote  Post ReplyReply Direct Link To This Post Posted: 16 May 2019 at 11:50am
Update: It look like a FireDAC issue, because when I change framework to ADO, then its fine and GetText event is triggered correctly :/
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3199
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2019 at 10:51am
Hi,

It's unclear exactly what is happening on database level, but perhaps this can be reported as a QC, as this is clearly a RAD Studio Rio issue. There is unfortunately very little that we can do to fix this issue.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down