Hi eldonfsr,
1.DBGPartsSup.SelectedIndex := 2;
The method DBGrid.SelectedIndex, just selects a particular column in the grid. Take a look at the attached image, the focus is on "ccc", if I press the select button 'ccc description' will be selected. That's it. The questions are:
1. Is your grid populated?
2. Do you have at least two columns?
2.if( not Tsql.EOF) then begin
BDPartSupl.edit;
BDPartSupl.FieldByName('SupplierName').AsString:= Tsql.FieldByName('CoName').AsString;
BDPartSupl.FieldByName('Supplierid').AsInteger:= Tsql.FieldByName('AddId').AsInteger;
BDPartSupl.Post;
end
What exactly are you trying to achieve? Loop through the dataset(Tsql) and modify each record for BDPartSupl? Or something else?