unit GridDirectEdit;

interface

uses
  Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, Controls,
  IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWWebGrid,
  IWAdvWebGrid, IWCompButton, IWCompRectangle, IWTMSCtrls, IWCompLabel,
  IWCompListbox, Forms, TopFrame, IWTMSMenus, LeftFrame, IWFont;

type
    TformGridDirectEdit = class(TIWAppForm)
    TIWAdvWebGrid1: TTIWAdvWebGrid;
    IWButton2: TIWButton;
    IWLabel1: TIWLabel;
    IWComboBox1: TIWComboBox;
    IWButton1: TIWButton;
    IWListbox1: TIWListbox;
    FrameTopFrame1: TFrameTopFrame;
    FrameLeftFrame1: TFrameLeftFrame;
    IWLabel2: TIWLabel;
    procedure IWButton2Click(Sender: TObject);
    procedure IWButton1Click(Sender: TObject);
   public
  end;

implementation

{$R *.dfm}



procedure TformGridDirectEdit.IWButton2Click(Sender: TObject);
begin
  TIWAdvWebGrid1.Cells[1,0] := 'text';
  TIWAdvWebGrid1.Cells[2,0] := '123';
  TIWAdvWebGrid1.Cells[3,0] := 'Option 1';
  TIWAdvWebGrid1.Cells[4,0] := '23/11/2004';
  TIWAdvWebGrid1.Cells[5,0] := 'a scroll field can hold long texts and adds a scrollbar if required';
  TIWAdvWebGrid1.Cells[6,0] := 'popup editor';
  TIWAdvWebGrid1.Cells[7,0] := '0';

end;


procedure TformGridDirectEdit.IWButton1Click(Sender: TObject);
var
 i: integer;
begin
  IWListbox1.Clear;
  for i := 1 to TIWAdvWebGrid1.Columns.Count-1 do
    IWListbox1.Items.Add(TIWAdvWebGrid1.Cells[i,IWComboBox1.ItemIndex]);
end;

initialization
  TformGridDirectEdit.SetAsMainForm;

end.
