我在dbgrid显示中,我想通过用户的选择使dbgrid 为可编辑状态或不可编辑状态,但我发现一旦选择了Options 中的dgrowselect属性就改变不会可编辑状态了,为什么啊,代码如下
begin
if CheckBox1.Checked then
begin
DBGrid2.Options :=DBGrid2.Options-[dgrowselect,dgAlwaysShowSelection];
DBGrid2.ReadOnly :=false;
end
else
begin
DBGrid2.Options :=DBGrid2.Options+[dgrowselect,dgAlwaysShowSelection];
DBGrid2.ReadOnly :=true;
end;
end;
begin
if CheckBox1.Checked then
begin
DBGrid2.Options :=DBGrid2.Options-[dgrowselect,dgAlwaysShowSelection];
DBGrid2.ReadOnly :=false;
end
else
begin
DBGrid2.Options :=DBGrid2.Options+[dgrowselect,dgAlwaysShowSelection];
DBGrid2.ReadOnly :=true;
end;
end;
解决方案 »
- 关于ole嵌入word,rpc服务器不可用问题!!!!!
- 请推荐一些数据库开发的书
- Delphi+Oracle+三层+ClientDataset无法存BLOB或Long Raw字段
- Delphi 7中怎么没有类似Delphi 5中的QuickReport
- 求助,关于fastreport
- 请问哪里有Windows98/2000/Me的繁体中文版下载!
- 请 coolicelee 先生 :请 Copy_Paste 大哥 ,请各位朋友,请进 :), 感谢您,感谢你们在我最困难的时候给我的帮助,有好多好多人,已记不
- 每次用select max(a)..取到一个值再+1作为唯一ID,但是有时会有多人同时取到该值而使数据不唯一。怎么解决。
- 急急急:ActionMainMenuBar1上放一个Tmainmenu组件,但是在新加一个菜单项后。运行时却不显示出来。
- Delphi Valentine's Day
- 迷惑????fastreport2.47打印预览中的问题
- 一个DBGrid的问题?UP有分
DBGrid2.Options :=DBGrid2.Options+[dgediting];
值 意义
dgrowselect 用户在选择某一单元格时,该列全部被选择。改值为true时,dgediting与
dgalwaysshoweditor 被忽略。