Jump to content
Sign in to follow this  
IElite

TW3Grid's Cells

Recommended Posts

Having a hard time working with the Grid's cells

this works

procedure TTestGrid.DrawBorders;
begin
 for var c:= 0 to 6 do 
  for var r:= 0 to 5 do 
  begin
   var C:=  (Cell[c, r] as TW3CustomControl);
   C.Border.Style:= besSolid;
  end;
end;

but I get the compiler message
Hint: Name "C" could be ambiguous in its scope context [line: 311, column: 7, file: TestGrid]

this does not work

procedure TTestGrid.ResetGrid;
begin
 for var i:= 0 to 6 do
 for var j:= 0 to 5 do
 begin
  Cell[i, j].Value:= '';
  (Cell[i, j] as TW3CustomControl).TagValue:= 0;
  (Cell[i, j] as TW3CustomControl).Color:= clWhite;
  (Cell[i, j] as TW3CustomControl).Font.Color:= clBlack;
  end;
end;

even tried

procedure TTestGrid.ResetGrid;
begin
 for var i:= 0 to 6 do
 for var j:= 0 to 5 do
 begin
  Cell[i, j].Value:= '';
  var C:=  (Cell[i, j] as TW3CustomControl);
  C.TagValue:= 0;
  C.Color:= clWhite;
  C.Font.Color:= clBlack;
  end;
end;


I get the following error when running

TypeError, Cannot read property "ClassType" of undefined


How could one work and not the other.  

procedure TW3Calendar.Resize;
begin
 inherited;
 if  (Handle.Valid and (csReady in ComponentState)) then
  ResetGrid;
end;

What cant i see here?

Share this post


Link to post
Share on other sites

Another thing you should probably do is to not use hard coded values there for col and row counts.

Seeing you struggling with that grid component, it might be a good idea for us to work together with the new grid component. Would you be interested?

Share this post


Link to post
Share on other sites
6 hours ago, jarto said:

Another thing you should probably do is to not use hard coded values there for col and row counts.

Seeing you struggling with that grid component, it might be a good idea for us to work together with the new grid component. Would you be interested?

Sure!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×