CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Color cell text

by oflor » 10 Nov 2014 20:55

Hi Pals:

My versión that change background color due a value of a column of a grid.

Code: Select all
procedure TfrmParametrosPoliza.dbgAsegPolJQGridOptionsLoadComplete(
  Sender: TObject; AParams: TStringList);
var
  RowIds: TStrings;
  i: Integer;
  Data: ISuperObject;
  Cls1: ISuperObject;
  Cls2: ISuperObject;
  RowsData:  TIWCGJQVarArray;
begin
  RowIds:= TStringList.Create;
  try
    Data:= SO();

    Cls1:= SO();
    Cls1.S['background']:= 'red';

    Cls2:= SO();
    Cls2.S['background']:= 'blue';

    dbgAsegPol.GetRowIds(RowIds);
    RowsData := dbgAsegPol.GetColValues(0);

    // Paint the cels of the grid conditionally
    for i:= 0 to RowIds.Count - 1 do
      if RowsData[i] = '0104' then // Is a Live Section?
        dbgAsegPol.JQGridOptions.SetRowData(RowIds[i],Data,Cls1)
      else
        dbgAsegPol.JQGridOptions.SetRowData(RowIds[i],Data,Cls2);
  finally
    RowIds.Free;
  end;
end;


Best Regards to all
Best Regards,...
Oscar Flor
Sebaot Software
oflor
 
Posts: 8
Joined: 24 Jun 2014 23:45

Previous

Return to JQGrid

Who is online

Users browsing this forum: No registered users and 21 guests

Contact Us.