面 面条 Unregistered / Unconfirmed GUEST, unregistred user! 1999-10-29 #2 dbgrid.colunm.clear; for i:=1 to ... dbgrid.column.add dbgrid.Columns.Items.Grid.Fields[i-1]:=table1.fields[i-1]
dbgrid.colunm.clear; for i:=1 to ... dbgrid.column.add dbgrid.Columns.Items.Grid.Fields[i-1]:=table1.fields[i-1]
C cAkk Unregistered / Unconfirmed GUEST, unregistred user! 1999-10-29 #3 var col:tcolumn; begin col:=dbgrid.Columns.Add; col.FieldName:='字段名'; col.Title.Caption:='标题名'; col.Title.Alignment:=标题的:居中/居左/居右; col.Width:=宽度; col.Alignment:=内容的:居中/居左/居右; //....等等其他的属性 end;
var col:tcolumn; begin col:=dbgrid.Columns.Add; col.FieldName:='字段名'; col.Title.Caption:='标题名'; col.Title.Alignment:=标题的:居中/居左/居右; col.Width:=宽度; col.Alignment:=内容的:居中/居左/居右; //....等等其他的属性 end;
面 面条 Unregistered / Unconfirmed GUEST, unregistred user! 1999-10-29 #4 错了, 是这样: procedure TForm1.Button1Click(Sender: TObject); var i,j:integer; begin dg.Columns.Clear; i:=table1.Fields.Count; for j:=0 to i-1 do begin dg.Columns.Add; dg.Columns.Items[j].field:=table1.Fields[j] end; end;
错了, 是这样: procedure TForm1.Button1Click(Sender: TObject); var i,j:integer; begin dg.Columns.Clear; i:=table1.Fields.Count; for j:=0 to i-1 do begin dg.Columns.Add; dg.Columns.Items[j].field:=table1.Fields[j] end; end;
C cytown Unregistered / Unconfirmed GUEST, unregistred user! 1999-10-29 #5 var colu:TColumn; begin colu:=dbgrid1.Columns.Add; colu.Title.Caption:='test'; colu.Width:=100; colu.FieldName:='ID';
var colu:TColumn; begin colu:=dbgrid1.Columns.Add; colu.Title.Caption:='test'; colu.Width:=100; colu.FieldName:='ID';