DBAdvSmoothListBox

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

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 :)

The normal way to handle this is to implement the DB field's OnGetText event.

See also:
https://borland.public.delphi.database.interbaseexpress.narkive.com/1IxHQAWp/displaying-blob-field-in-dbgrid

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. 

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.

Hi, thx. I'll try that :)

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;

Update: It look like a FireDAC issue, because when I change framework to ADO, then its fine and GetText event is triggered correctly :/

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.