السلام عليكم أخواني الأكارم
عند أدخال قيمة في أي سطر في العمود الأول من الـ stringgrid عمل فلترة في الجدول (table) عن الـرقم المطلوب(ID)
ثم تحميل باقي الخلايا من الجدول إلى الـ stringgrid
الكود هو التالي لكن ما هو الحدث
var id : integer ;
begin
if ( col = 0 ) then
begin
id := strtoint(stringgrid1.Cells[0,row] ;
table.Filtered := false ;
table.Filter := 'id = id ' ;
table.First ;
table.Filtered := true ;
if table.RecordCount = 1 then
begin
stringgrid1.Cells[1,row] := table.FieldValues['code'] ;
stringgrid1.Cells[2,row] := table.FieldValues['name'] ;
stringgrid1.Cells[1,row] := table.FieldValues['address'] ;
stringgrid1.Cells[4,row] := table.FieldValues['phone'] ;
stringgrid1.Cells[5,row] := table.FieldValues['mob'] ;
end
else
begin
showmessage('id is existent') ;
end ;
end ;