问题
I am trying to display items from a list of objects. I want to display the data in the following format as shown in the picture.
type
TFeedItem = class
private
FTitle: string;
FDescription: string;
FLink: string;
FImageUrl: string;
public
property Title: string read FTitle;
property Description: string read FDescription;
property Link: string read FLink;
property ImageUrl: string read FImageUrl;
end;
//Code to disply items
var
I: Integer;
list: TObjectList<TFeedItem>
begin
for I := 0 to list.count - 1 do
begin
// display each item of the list into dbctrlgrid
end;
end;
A search results the following threads:
Link1: Delphi control that could mimic "Add-ons|Extension list" of Firefox?
Link2: Custom draw ListBox items with a panel
As per suggestions, I tried to use dbctrlgrid but I could use it only with database using datasource property assigning to the TFDTable. So the question is, how can it be done without datasource?
Edit: The question was ambiguous. So, I updated it and added a sample structural code.
来源:https://stackoverflow.com/questions/33057500/displaying-items-on-the-dbctrlgrid-without-datasource-in-delphi