当数据集处于插入模式时,我无法更改 TcxGrid 字段值
我使用 delphi2010 和 oracle 10g 作为数据库
我的 TcxGrid 连接到数据集(qryDONEMSEL -> TOraQuery),当我想通过单击按钮向数据库添加某些内容时,我将数据集更改为插入模式,但 TcxGrid 中的字段未启用,什么是问题 ?
按钮内的代码如下
if (qryDONEMSEL.RecordCount = 0) then
begin
qryDONEMSEL.Insert;
qryDONEMSEL.FieldByName('YIL').asinteger := STRTOINT(Util.GETSQL('SELECT OGIS.AKTIFYIL FROM DUAL'));
qryDONEMSEL.FieldByName('donem').asinteger := STRTOINT(Util.GETSQL('SELECT OGIS.AKTIFDONEM FROM DUAL'));
qryDONEMSEL.FieldByName('DURUM').AsString := 'ST1';
// qryDONEMSEL.FieldByName('sinif').ASstring := 'C2';
// qryDONEMSEL.FieldByName('okudugu_somestre').ASinteger := 1;
// 9 - Transfer kayıt sebebi
if (POS('9', qryOGR.FieldByName('kay_sebep').AsString) > 0) then
begin
showmessage(gsLabels('Öğrenci transfer olarak kayıtlı.', self, 'OGIS') + #13#10 + gsLabels('Sınıf ve Sömestresini dikkatli ve doğru girin.', self, 'OGIS'));
end;
end
有人能给我建议吗?
I am using delphi2010 and oracle 10g as a database
My TcxGrid is conected to dataset (qryDONEMSEL -> TOraQuery) when I want to add something to database by clicking button I change dataset to insert mode BUT the fields in TcxGrid are not enabled what is the problem ?
Code inside button as follow
if (qryDONEMSEL.RecordCount = 0) then
begin
qryDONEMSEL.Insert;
qryDONEMSEL.FieldByName('YIL').asinteger := STRTOINT(Util.GETSQL('SELECT OGIS.AKTIFYIL FROM DUAL'));
qryDONEMSEL.FieldByName('donem').asinteger := STRTOINT(Util.GETSQL('SELECT OGIS.AKTIFDONEM FROM DUAL'));
qryDONEMSEL.FieldByName('DURUM').AsString := 'ST1';
// qryDONEMSEL.FieldByName('sinif').ASstring := 'C2';
// qryDONEMSEL.FieldByName('okudugu_somestre').ASinteger := 1;
// 9 - Transfer kayıt sebebi
if (POS('9', qryOGR.FieldByName('kay_sebep').AsString) > 0) then
begin
showmessage(gsLabels('Öğrenci transfer olarak kayıtlı.', self, 'OGIS') + #13#10 + gsLabels('Sınıf ve Sömestresini dikkatli ve doğru girin.', self, 'OGIS'));
end;
end
Can anyone advice me something ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了这个问题。
这是因为在一个函数中有一行如下禁用字段。
grdDonemselView.columns[i].Options.Editing := False;
或更改为
grdDonemselView.columns[i].Options.Editing := True;
解决了问题
I solved the problem.
It is because in one function there was a line as below that disables fields.
grdDonemselView.columns[i].Options.Editing := False;
or change to
grdDonemselView.columns[i].Options.Editing := True;
solved the problem