{***************************************************************************}
{ TMS IntraWeb Component Pack Pro                                           }
{ for Delphi & C++Builder                                                   }
{ version 2.2                                                               }
{                                                                           }
{ written by TMS Software                                                   }
{            copyright © 2002 - 2007                                        }
{            Email : info@tmssoftware.com                                   }
{            Web : http://www.tmssoftware.com                               }
{                                                                           }
{ The source code is given as is. The author is not responsible             }
{ for any possible damage done due to the use of this code.                 }
{ The component can be freely used in any application. The complete         }
{ source code remains property of the author and may not be distributed,    }
{ published, given or sold in any form as such. No parts of the source      }
{ code can be included in any other component or application without        }
{ written authorization of the author.                                      }
{***************************************************************************}
unit IWCustomGrid;


interface

uses
  Classes, IWWebGrid, IWAdvWebGrid, IWDBAdvWebGrid;

type  
  TOurTIWDBWebGridColumn = class(TTIWDBWebGridColumn)
  private
    FMyProp : string;
  published
    property MyProp : string read  FMyProp write FMyProp;
  end;

  TOurTIWDBWebGridColumns = class(TTIWDBWebGridColumns)
  private
  public
    function GetItemClass: TCollectionItemClass; override;
  end;

  TOurTIWDBAdvWebGrid = class(TTIWDBAdvWebGrid)
  private
    { Private declarations }
  protected
    { Protected declarations }
  public
    { Public declarations }
  function CreateColumns : TTIWWebGridColumns; override;
  published
    { Published declarations }
  end;

procedure Register;
 
implementation
 
function TOurTIWDBAdvWebGrid.CreateColumns : TTIWWebGridColumns;
begin
//  Result := TOurTIWDBWebGridColumn.Create(Self.Columns) ; // TMS GRID - ERROR IN COMPILATION

//  Result := TDBGridColumns.Create(Self, TCommitColumn); // Original Delphi DBgrid

  Result := TOurTIWDBWebGridColumns.Create(Self);
end;
{}
 
procedure Register;
begin
  RegisterComponents('xx', [TOurTIWDBAdvWebGrid]);
end;

{ TOurTIWDBWebGridColumns }

function TOurTIWDBWebGridColumns.GetItemClass: TCollectionItemClass;
begin
  result := TOurTIWDBWebGridColumn;
end;

end.
 