Displaying items on the dbctrlgrid without datasource in Delphi

不打扰是莪最后的温柔 提交于 2019-12-24 12:39:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!