Delphi7中有没可以直接在cell中输入数据的gird控件?在那个页签下啊?
解决方案 »
- SyneditStudio安装问题?
- 在TreeView节点的前面加了个复选框,怎样判断是否在checkbox前打勾了呢?
- 关于FastReport多页打印报表的难题。。。。在线等待
- DELPHI中有很多内部函数,比如STRTOFLOAT什么的,有没有什么资料书籍详细描述这些函数吗??
- 我用installshield profeessional做出来的安装包,为什么要执行两次,才能把程序安装成功呢?请指点.
- 一个关于ComboBox的问题。
- QuickRep报表打印问题?在线等待!高手的清清一点!
- 女朋友问题
- 远程控制问题
- 请问在delphi编程中如何自画excel的边框线?
- 大家帮我看看这语句错在哪里?
- 请问怎么控制局域网内的电脑不能上网的实现原理或源程序。
F1Book 没用过..看上去不错..我一般都用TMS AdvStringGrid
PDicField=^TDicField;
TDicField=record
code : string; {表代码}
id : integer; {序号}
name : string; {字段名称}
cName : string; {中文名称}
sName : string; {显示名称}
constant : string; {字段常量}
userType : char; {字段用户类型}
isShow : boolean; {是否显示}
showBlock: string; {显示控制块}
format : string; {显示格式}
width : integer; {宽度}
uiType : char; {界面表现形式}
ctrl : smallint; {控制字}
query : boolean; {是否可作为查询条件}
end;
{字段列表--------------------------------------------------------------------}
TDicFieldList=record
nFields: integer;
fields : array of TDicField;
end;//动态生成DBGrid表头,生成的表头来自字典。
//动态生成时,可控制各列的表现形式,如下拉框、按钮,并且可控制读/写属性
procedure G_BuildDBGridHead(const DBGrid: TDBGrid; DicFields: TDicFieldList);
var
i: Integer;
ValueLst: TStrings;
newColumn: TColumn;
begin
DBGrid.Columns.Clear;
for i:=0 to DicFields.nFields-1 do
begin
if not DicFields.Fields[i].isShow then Continue;
newColumn := DBGrid.Columns.Add;
newColumn.Title.Alignment := taCenter;
newColumn.Title.Caption := DicFields.Fields[i].sName;
newColumn.FieldName := DicFields.Fields[i].name;
newColumn.Width := DicFields.Fields[i].width; case DicFields.Fields[i].uiType of
'C':begin
ValueLst := TStringList.Create;
G_SeperateString(DicFields.Fields[i].constant,ValueLst);
newColumn.PickList.AddStrings(ValueLst);
newColumn.DropDownRows := 20;
ValueLst.Free;
newColumn.Color := clCream;
newColumn.ButtonStyle := TColumnButtonStyle(cbsAuto);
end;
'B':NewColumn.ButtonStyle := TColumnButtonStyle(cbsEllipsis);
end;
newColumn.ReadOnly := DicFields.fields[i].ctrl<3;
if newColumn.ReadOnly then newColumn.Color := clReadOnly;
end;
if DBGrid.ReadOnly then DBGrid.Options := DBGrid.Options+[dgRowSelect];
end;