SmartBind have xxxxx:DataSet not in edit mode error message.

Home Forums kbmMW SmartBind have xxxxx:DataSet not in edit mode error message.

Viewing 3 reply threads
  • Author
    Posts
    • #55770
      TomYU
      Participant

      hi,kim

      NavigatorPH: IkbmMWBinding;

      NavigatorPH.Navigator.Append;

      NavigatorPH.Navigator.Value[‘fcs’] := 6;// Show xxxx.DataSet not in edit mode .

      kbmMW 5.15.10

      best regards

      Tom YU.

       

    • #55771
      TomYU
      Participant

      fixed code:

      procedure TkbmMWBindingDataSourceNavigator.SetValue(const AName:string; const AValue:TValue);
      var
      fld:TField;
      begin
      if IsValid then
      begin
      fld:=FDataSource.Dataset.FindField(AName);
      if fld<>nil then
      begin
      if not (FDataSource.Dataset.State in [dsEdit,dsInsert]) then //+++++
      FDataSource.DataSet.Edit;//+++++
      fld.AsVariant:=TkbmMWRTTI.ConvertValue2Variant(AValue,nil);
      FDataSource.DataSet.Post;//+++++
      end;
      end;
      end;

    • #55773
      TomYU
      Participant

      hi, kim

      In fact, this problem has existed since 5.10.10, and we look forward to official corrections.

      best regards

      Tom YU.

       

    • #55776
      kimbomadsen
      Keymaster

      Hi,
      Thank you for your bugreport and suggestion for a solution.
      I have implemented a variant of it for next release.

      procedure TkbmMWBindingDataSourceNavigator.SetValue(const AName:string; const AValue:TValue);
      var
         fld:TField;
         b:boolean;
      begin
           if IsValid then
           begin
                fld:=FDataSource.Dataset.FindField(AName);
                if fld<>nil then
                begin
                     b:=FDataSource.Dataset.State in [dsEdit,dsInsert];
                     if not b then
                        FDataSource.DataSet.Edit;
                     fld.AsVariant:=TkbmMWRTTI.ConvertValue2Variant(AValue,nil);
                     if not b then
                        FDataSource.DataSet.Post;
                end;
           end;
      end;
      

      /Kim

Viewing 3 reply threads
  • You must be logged in to reply to this topic.