The StringGrid With JSON Data Demo is a powerful and easy-to-use tool for building dynamic and interactive applications. The demo shows how to populate a stringgrid using JSON data, and is a cross-platform application that can be used on Android, iOS, macOS, Windows, and Linux. The demo is built in Delphi using a single code base and single UI, making it easy to create beautiful and robust applications. With the StringGrid With JSON Data Demo, you can quickly create sophisticated and user-friendly applications that are sure to impress your users.

Download the full cross-platform StringGrid from JSON source code on Github.

This demo is part of over 100 cross-platform demos with everything from camera demos to emoji demos and painting demos.

What is a StringGrid in software development?

A stringgrid is a software development tool that allows developers to create and manipulate string data. It is composed of a grid of cells, each of which can store a string value. stringgrids are often used to store tabular data, such as database records or spreadsheet data. They can also be used to create text-based user interfaces, such as text editors or web browsers. stringgrids are highly versatile and offer a variety of ways to access and manipulate string data. As a result, they are an essential tool for many software development tasks.

What is JSON in software development?

JSON (JavaScript Object Notation) is a lightweight data-interchange format that is easy for humans to read and write, and easy for machines to parse and generate. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages (C, C++, JavaScript, and so on). These properties make JSON an ideal data-interchange language. JSON is often used in Ajax web applications, configuration files, and in various other situations where database information needs to be transported between systems. JSON’s ubiquity has led to its inclusion in many software development products and services. The JSON standard defines a small set of formatting rules for the portable representation of structured data.

Screenshot

What does the source code sample look like?

unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, REST.Types,
  FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Param,
  FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, FireDAC.DApt.Intf,
  System.Rtti, FMX.Grid.Style, Data.Bind.EngExt, Fmx.Bind.DBEngExt,
  Fmx.Bind.Grid, System.Bindings.Outputs, Fmx.Bind.Editors, FMX.StdCtrls,
  Data.Bind.Components, Data.Bind.Grid, Data.Bind.DBScope, FMX.ScrollBox,
  FMX.Grid, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client,
  REST.Response.Adapter, REST.Client, Data.Bind.ObjectScope, FMX.Effects,
  FMX.Controls.Presentation;

type
  TForm1 = class(TForm)
    MaterialOxfordBlueSB: TStyleBook;
    ToolBar1: TToolBar;
    ShadowEffect4: TShadowEffect;
    Label1: TLabel;
    RESTClient1: TRESTClient;
    RESTRequest1: TRESTRequest;
    RESTResponse1: TRESTResponse;
    RESTResponseDataSetAdapter1: TRESTResponseDataSetAdapter;
    FDMemTable1: TFDMemTable;
    StringGrid1: TStringGrid;
    BindSourceDB1: TBindSourceDB;
    BindingsList1: TBindingsList;
    LinkGridToDataSourceBindSourceDB1: TLinkGridToDataSource;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

procedure TForm1.Button1Click(Sender: TObject);
begin
  RESTRequest1.ExecuteAsync(
    procedure
      begin
        Label1.Text := 'Complete!';
        LinkGridToDataSourceBindSourceDB1.Active := False;
        LinkGridToDataSourceBindSourceDB1.Active := True;
      end,
    True,
    True,
    procedure (Sender: TObject)
      begin
        Label1.Text := 'Error!';
      end);
end;

end.

How are the data bindings set up?

Ready to learn how to program cross-platform apps like this?

Sign up for the Coding Boot Camp 2022 to learn to program. Topics include: Games, JavaScript, Web, Python, SQL, Databases, iOS, MacOS, Android, Mobile, Linux, Windows, Desktop, Server, and Arduino.


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition