I have no other events or procedures scripted on the TableGrid, The only scripts I'm using are to resize columns when the form shows.
Here is my script:
procedure newentry_OnShow (Sender: TObject; Action: string);
begin
newentry.TableGrid1.Columns[0].Width := 120;
newentry.TableGrid1.Columns[1].Width := 120;
newentry.TableGrid1.Columns[2].Width := 100;
newentry.TableGrid1.Columns[3].Width := 315;
end;
procedure Form1_OnShow (Sender: string; Action: string);
begin
Form1.TableGrid1.Columns[0].Width := 80;
Form1.TableGrid1.Columns[1].Width := 90;
Form1.TableGrid1.Columns[2].Width := 90;
Form1.TableGrid1.Columns[3].Width := 130;
Form1.TableGrid1.Columns[4].Width := 130;
Form1.TableGrid1.Columns[5].Width := 74;
Form1.TableGrid1.Columns[6].Width := 62;
end;
begin
end.
P.S. Now I get the message even when I click the edit record button.
EDIT: It seems like a bug in the program: The TableGrid I'm selecting the record from has only Name and Second Name fields. But I want to show complete details in the edit record form. But it isn't able to detect all the fields, but only the ones in the previous screen. SO column 3 doesn't exist, and hence can't be resized. So I get that error.
I have attached the project below.
Post's attachments Project1.rar 296.77 kb, 201 downloads since 2020-10-01