Delphi7中有没可以直接在cell中输入数据的gird控件 Delphi7中有没可以直接在cell中输入数据的gird控件?在那个页签下啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把DBGRID改成可写就行了啊,不知道你需要的是什么 我想要的是將gird控件中自由控制部分控件和編輯,部分不可編輯,我了解到有stringgrid,datagrid,drawgird,不知道哪個好~ 看一下cxGrid可否满足你的需要。 cxgird在哪個頁簽下面啊,哪個有這幾個gird控件的使用大全嗎?指點一下小弟不甚感謝 stringgrid 比较好控制~F1Book 没用过..看上去不错..我一般都用TMS AdvStringGrid datagrid 足够了,TColumn.ReadOnly可以控制其是否只读。 {表字段字典} 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; 求~~~救!!! 哪个可以发一个vfw.pas给我,网上找了很久没找到,谢谢! 关于打包好的程序启动的问题(急) 如何将5A转化成Z阿(大写)! 编辑过后dbedit 不能写入? StringGrid的中的每一格不能左右拉的更宽一点 请大家帮忙.在线等 类型转换问题 FileSeek,FileWrite的小问题(在线) 读不懂的语句 大家帮我看看这语句错在哪里? 请问怎么控制局域网内的电脑不能上网的实现原理或源程序。
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;