الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

حدث الأدخال في ال Stringgrid

بدأه rober في 26 يونيو 2008 · 1 رد · 474 مشاهدة · في لغة Delphi
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم أخواني الأكارم

عند أدخال قيمة في أي سطر في العمود الأول من الـ 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 ;

I'm Away For Sometimes

I'll Finish My Works

Come Back Soon

More Study > More Search > More Try > More Learning > Great Success

#2

تم أيجاد حل لكن بغير مثال

يمكن أستخدام الالحل على المثال السابق طبعا

procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);

var col,row : integer ;

begin

if key = char(VK_RETURN) then

begin

col := stringgrid1.Col ;

row := stringgrid1.Row ;

if col = 0 then

begin

stringgrid1.Cells[1,row] := edit1.Text ;

stringgrid1.Cells[2,row] := edit2.Text ;

stringgrid1.Cells[3,row] := edit3.Text ;

stringgrid1.Cells[4,row] := edit4.Text ;

end ;

end ;

end;

I'm Away For Sometimes

I'll Finish My Works

Come Back Soon

More Study > More Search > More Try > More Learning > Great Success

مواضيع مشابهة