Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS FMX UI Pack
Create a new custom grid descending from TTMSFMXGrid

When you create a new grid that descends from our TTMSFMXGrid control, make sure that in the new class, you override the protected method GetDefaultStyleLookupName to ensure your new grid control uses the base class TTMSFMXGrid default style resource. Sample code:
  TTMSFMXGridEx = class(TTMSFMXGrid)
  private
    { Private declarations }
  protected
    { Protected declarations }
    function GetDefaultStyleLookupName: string; override;
    function GetClassStyleName: String; override;
  public
    { Public declarations }
    procedure ApplyStyle; override;
  published
    { Published declarations }
  end;

function TTMSFMXGridEx.GetClassStyleName: String;
begin
  Result := ClassParent.ClassName + 'style';
  Delete(Result, 1, 1);
end;

function TTMSFMXGridEx.GetDefaultStyleLookupName: string;
begin
  Result := GetClassStyleName;
end;
Otherwise the style resource won't be found for the new descending grid control and it will appear empty.