Topic: Grid Focus ?
As illustrated above, I was trying to use Derek's myScroll script to achieve;
♦ Form1 onShow
- select first available record from upper pageControl
- Selected record details displayed on the lower pageControl.
The following script for customers tab works but I couldn't get Suppliers and Product tabs work?
var vrowid: integer;
// Customer
procedure MyScrollCUSTOMER;
begin
if Form1.PageControl1.ActivePageIndex = 0 then
begin
if Form1.tgMainCustomers.selectedrow < 0 then Form1.tgMainCustomers.selectedrow := 0;
vrowid := Form1.tgMainCustomers.selectedrow;
Form1.tgMainCustomers.selectedrow := vrowid;
Form1.tgMainCustomers.setfocus;
end;
end;
// Supplier
procedure MyScrollSUPPLIER;
begin
if Form1.PageControl1.ActivePageIndex = 1 then
begin
if Form1.tgMainSupplier.selectedrow < 0 then Form1.tgMainSupplier.selectedrow := 0;
vrowid := Form1.tgMainProducts.selectedrow;
Form1.tgMainSupplier.selectedrow := vrowid;
Form1.tgMainSupplier.setfocus;
end;
end;
// Product
procedure MyScrollPRODUCT;
begin
if Form1.PageControl1.ActivePageIndex = 2 then
begin
if Form1.tgMainProducts.selectedrow < 0 then Form1.tgMainProducts.selectedrow := 0;
vrowid := Form1.tgMainProducts.selectedrow;
Form1.tgMainProducts.selectedrow := vrowid;
Form1.tgMainProducts.setfocus;
end;
end;
God... please help me become the person my dog thinks I am.