如何在DBGird点选ROW时在TEXT1,2里显示其对应的数值(谢谢) 如何在DBGird点选ROW时在TEXT1,2里显示其对应的数值,新手急等,请各位大大详细点,谢谢,必送分。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 with Dbgrid.DataSource.DataSet dobegin Text1.Text := FieldByName('字段名').asString; Text2.Text := FieldByName('字段名').asString;end; procedure TForm1.DBGrid1CellClick(Column: TColumn);begin Text1.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring; Text2.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring;end; procedure TForm1.DBGrid1CellClick(Column: TColumn);begin Text1.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring; Text2.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring;end; 这个好象不能达到要求,我想要的不是单独去点击某项来单独显示,而是想得到的效果是点击一项时在DBGRID里的所有自段都自动添加到TEXT1,TEXT2。谢谢 procedure TForm1.DBGrid1CellClick(Column: TColumn);begin Text1.Text := ''; Text2.Text := ''; DBGrid1.DataSource.DataSet.First; while not(DBGrid1.DataSource.DataSet.eof) do begin Text1.Text := Text1.Text + DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring; Text2.Text := Text2.Text + DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring; DBGrid1.DataSource.DataSet.Next; end;end; zwb666(zwb)的可以呀,你需要哪些字段就取哪些字段赋给EDIT就可以了 procedure TForm1.DBGrid1CellClick(Column: TColumn);begin Text1.Text := DBGrid1.DataSource.DataSet.FieldByName('xx').asstring; Text2.Text := DBGrid1.DataSource.DataSet.FieldByName('xx').asstring;end; meiqingsong(阿飛) 的方法可以 procedure TForm1.DBGrid1CellClick(Column: TColumn);begin Text1.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring; Text2.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring;end;//这样就行 請問一下dbedit1的OnExit事件在什麽時候會觸發? 支持三J当大版 嘿嘿 是该换换界了.....(两年了放点分不容易哎~~) 怎样给sql语句中的参数赋空值? 窗口form的caption的字体突然变小了 如何通过DLL获得数据集,并把该数据集传递到主程序的数据控件?急!!! 紧急!!! 窗体问题。。。 请问怎么样adodataset编辑一条记录 怎样实现电脑一上网便自动完成些事情? delphi怎么不能自动完成关键字 高分求助,quickReport怎么转化为dbf文件啊? 怎么打印报表
begin
Text1.Text := FieldByName('字段名').asString;
Text2.Text := FieldByName('字段名').asString;
end;
begin
Text1.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring;
Text2.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring;
end;
begin
Text1.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring;
Text2.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring;
end;
begin
Text1.Text := '';
Text2.Text := '';
DBGrid1.DataSource.DataSet.First;
while not(DBGrid1.DataSource.DataSet.eof) do
begin
Text1.Text := Text1.Text + DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring;
Text2.Text := Text2.Text + DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring;
DBGrid1.DataSource.DataSet.Next;
end;
end;
begin
Text1.Text := DBGrid1.DataSource.DataSet.FieldByName('xx').asstring;
Text2.Text := DBGrid1.DataSource.DataSet.FieldByName('xx').asstring;
end;
begin
Text1.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring;
Text2.Text := DBGrid1.DataSource.DataSet.FieldByName('字段名').asstring;
end;
//这样就行