CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Trying to update a single row using .SetRowData

by ScottWGast » 22 Oct 2019 19:32

I can't figure out why the single row is not being updated; I've verified the contents of RowData..

Code: Select all
procedure TframeGridBase.UpdateSingleGridRow(ID: String);
var
  RowData: ISuperObject;
  bmTemp: TBookmark;
  strFieldName: String;
  i: Integer;
begin

  bmTemp := Self.gridDatasetProvider.DataSet.GetBookmark;
  TADODataSet(Self.gridDatasetProvider.DataSet).Requery([TExecuteOption.eoAsyncFetch]);
  Self.gridDatasetProvider.DataSet.GotoBookmark(bmTemp);
  Self.gridDatasetProvider.DataSet.FreeBookmark(bmTemp);

    // set the RowData from the refreshed dataset
  RowData := SO();
  for i := 0 to Self.gridData.JQGridOptions.ColModel.Count - 1 do
    begin
      strFieldName := Self.gridData.JQGridOptions.ColModel[i].SQLFieldName;
      RowData.S[strFieldName] := Self.gridDatasetProvider.DataSet.FieldByName(strFieldName).AsString;
    end;

    RowData.SaveTo(UserSession.UserTempDir + 'test_rowdata.txt');

  //
  //  WHY DOES THIS NOT UPDATE THE ROW IN THE GRID display?
  //
    Self.gridData.JQGridOptions.SelRow := ID;
    Self.gridData.JQGridOptions.SetRowData(Self.gridData.JQGridOptions.SelRow, RowData, '');

end;


I've used this technique in the past with great success, but it's not working for some reason. All fields are lowercase so there shouldn't be a problem with case sensitivity.

Does anyone have suggestions?

Thank you in advance,
Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by ScottWGast » 04 Nov 2019 15:22

Hello? Anybody?

Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02


Return to JQGrid

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.