Syntax to change a Toast Header

Hopefully a simple one.

procedure TForm1.WebResponsiveGrid1ItemClick(Sender: TObject; Index: Integer);

  begin

     WebToast1.Items[0].Header :=  WebResponsiveGrid1.Items[index].HTML;
     WebToast1.Items[0].Show;
  end;

Use:

procedure TForm1.WebResponsiveGrid1ItemClick(Sender: TObject; Index: Integer);
 begin
     WebToast1.Items[0].Header :=  WebResponsiveGrid1.Items[index].HTML;
     WebToast1.Items[0].Update;
     WebToast1.Items[0].Show;
 end;

I tried that it shows Undeclared identifier. Is there a unit I need to add ?

Just compile & run.

That works thanks.

I am using

     WebToast1.Items[0].Header := IntToStr(WebResponsiveGrid1.ItemIndex);// .Items[index].Index);//.HTML;
     WebToast1.Items[0].Update;
     WebToast1.Items[0].Show;

This works okay.

If I click the x ( close the toast ) then click the grid I get this error

TMSWEB_ResponsiveGrid.js:3995 Uncaught {fMessage: 'List index (0) out of bounds'}
Error @ TMSWEB_ResponsiveGrid.js:3995
RaiseIndexError @ TMSWEB_ResponsiveGrid.js:3968
Get @ TMSWEB_ResponsiveGrid.js:3950
GetItem @ TMSWEB_ResponsiveGrid.js:4809
GetItem$1 @ TMSWEB_ResponsiveGrid.js:15853
WebResponsiveGrid1ItemClick @ TMSWEB_ResponsiveGrid.js:16117
cb @ TMSWEB_ResponsiveGrid.js:245
HandleDoItemClick @ TMSWEB_ResponsiveGrid.js:14931
HandleDoClick @ TMSWEB_ResponsiveGrid.js:14978
cb @ TMSWEB_ResponsiveGrid.js:241
TMSWEB_ResponsiveGrid.js:3995 Uncaught {fMessage: 'List index (0) out of bounds'}
Error @ TMSWEB_ResponsiveGrid.js:3995
RaiseIndexError @ TMSWEB_ResponsiveGrid.js:3968
Get @ TMSWEB_ResponsiveGrid.js:3950
GetItem @ TMSWEB_ResponsiveGrid.js:4809
GetItem$1 @ TMSWEB_ResponsiveGrid.js:15853
WebResponsiveGrid1ItemClick @ TMSWEB_ResponsiveGrid.js:16117
cb @ TMSWEB_ResponsiveGrid.js:245
HandleDoItemClick @ TMSWEB_ResponsiveGrid.js:14931
HandleDoClick @ TMSWEB_ResponsiveGrid.js:14978
cb @ TMSWEB_ResponsiveGrid.js:241

If a toast item is displayed and closed it is auto destroyed and can't be shown again.
You'd need to create a new toast item.