0

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 ?

RRUZ
  • 134,889
  • 20
  • 356
  • 483
Shahriar
  • 25
  • 3
  • 11

1 Answers1

1

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

Shahriar
  • 25
  • 3
  • 11