DelphiFan Magazine

Top Menu

Main Menu

  • DELPHI
  • CODE SAMPLES
  • FIREMONKEY
  • DATABASE
  • RELEASES
  • VIDEOS
  • REVIEW
  • TECH NEWS

logo

DelphiFan Magazine

  • DELPHI
  • CODE SAMPLES
  • FIREMONKEY
  • DATABASE
  • RELEASES
  • VIDEOS
  • REVIEW
  • TECH NEWS
  • How to add a server application written in UNIGUI to startup?

  • UniGUI Expiry Link Anonymizer

  • UniGUI Add CAPTCHA to the WEB project

  • UniGui. Unique hybrid of Delphi and JS

  • How to transform a blob field into string lines (varchar) in SQL Firebird?

CODE SAMPLESDELPHI
Home›CODE SAMPLES›Good code samples for cxGrid Part2

Good code samples for cxGrid Part2

By admin
October 26, 2020
1051
0
Share:
  1. CxGrid summary function

① Set OptionsView-Footer to True to display the footer. ② The Summary tab of CxGrid defines the column and field names to be summarized and the summary method, the Footer tab defines a single summary, and Default For Groups defines a summary by group. OptionsView-GroupFooters is set to gfAlwaysVisible to display group summary. The interface is shown in the figure after setting.

① Set OptionsView-Footer to True to display the footer. ② The Summary tab of CxGrid defines the column and field names to be summarized and the summary method, the Footer tab defines a single summary, and Default For Groups defines a summary by group. OptionsView-GroupFooters is set to gfAlwaysVisible to display group summary. The interface is shown in the figure after setting.

  1. CxGrid style settings When Kind is set, NativeStyle must be set to False. If SkinName is specified, the Kind property is invalid.

The picture below is the effect after setting skinname to MoneyTwins

3. Import various formats

procedure TForm1.btn1Click(Sender: TObject);

begin

cxGridExportLink.ExportGridToHTML('d:\test.html',cxgrd1);

cxGridExportLink.ExportGridToXML('d:\test.xml',cxgrd1);

cxGridExportLink.ExportGridToExcel('d:\test.xls',cxgrd1);

cxGridExportLink.ExportGridToText('d:\test.txt',cxgrd1);

end;

4.Take the value of a cell

Cxgrid.DataController.Values[i,j]

5.Column operation, after selecting the CxGrid control, click “Customize” to create a new column, select the newly created column in the Columns collection, and select the properites property to set the display form of the column. Here are a few commonly used

① When Properties select CheckBox, a check box is displayed in this column, as follows:

Determine whether to select if Cxgrid.DataController.Values[i,j]=’1’ select

② Properties select ButtonEdit, and set the following properties to the property editor of the column to add button items to the Buttons property. For the button item settings, you can set the kind property to define the button style; the ViewStyle property is set to vsButtonsOnly, and Options-ShowEditButton is set to isebAlways. You can write click events as follows:

procedure TForm1.cxgrdbtblvwGrid1DBTableView1Column1PropertiesButtonClick(

  Sender: TObject; AButtonIndex: Integer);

begin

  ShowMessage('aaa');

end;

③ ImageComboBox can be associated with an imagelist to display pictures. The effect after associating the imagelist as follows.

6.Dynamically add columns and record rows

var

Column:   TcxGridColumn;

i:integer;

acount:integer;

 

begin

    Column:= cxgrd1TableView1.CreateColumn;

    Column.Caption   :=   'Test ';

    cxgrd1TableView1.DataController.AppendRecord;

    cxgrd1TableView1.DataController.Values[0,   0]   :=   'ABC ';

cxgrd1TableView1.DataController.Post;

//Add multiple records

for i:=1 to 4 do

  begin

    acount:=cxgrd1TableView1.DataController.RecordCount;

    cxgrd1TableView1.DataController.AppendRecord;

    cxgrd1TableView1.DataController.Values[acount,   0]   :=IntToStr(i*1);

    cxgrd1TableView1.DataController.Post();

  end;

end;

//Delete Record

cxgrd1TableView1.DataController.DeleteRecord(0);

end;
Tagscxgridcxgrid samplesdelphidelphi cxgrid
Previous Article

Build ssl website with Delphi Unigui

Next Article

Good code samples for cxGrid Part3

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0
  • 0

admin

Related articles More from author

  • CODE SAMPLESDELPHI

    Build ssl website with Delphi Unigui

    October 23, 2020
    By admin
  • CODE SAMPLESDELPHI

    UniGUI Expiry Link Anonymizer

    January 27, 2021
    By admin
  • CODE SAMPLESDELPHI

    How to add a server application written in UNIGUI to startup?

    January 27, 2021
    By admin
  • DELPHIRELEASES

    FastReport 6.8 VCL Released

    September 22, 2020
    By admin
  • DELPHIVIDEOS

    Setup and deploy of first iOS App with Delphi

    September 27, 2020
    By admin
  • CODE SAMPLESDELPHI

    View the output function list of DLL

    January 1, 2021
    By admin

Leave a reply Cancel reply

You may interested

  • CODE SAMPLESDELPHI

    How create a new uniGUI application

  • DELPHIRELEASES

    Custom High Performance VCL Component Suite For Delphi/C++ Builder By ErrorSoft

  • CODE SAMPLESDELPHI

    How does Delphi handle different types of files

  • LATEST REVIEWS

  • TOP REVIEWS

Timeline

  • January 27, 2021

    How to add a server application written in UNIGUI to startup?

  • January 27, 2021

    UniGUI Expiry Link Anonymizer

  • January 26, 2021

    UniGUI Add CAPTCHA to the WEB project

  • January 26, 2021

    UniGui. Unique hybrid of Delphi and JS

  • January 13, 2021

    How to transform a blob field into string lines (varchar) in SQL Firebird?

Latest Comments

Find us on Facebook

Follow Us on Instagram

logo

Our website, law, laws, copyright and aims to be respectful of individual rights. Our site, as defined in the law of 5651 serves as a provider of space. According to the law, contrary to the law of site management has no obligation to monitor content. Therefore, our site has adopted the principle of fit and remove. Works are subject to copyright laws and is shared in a manner that violated their legal rights, or professional associations, rights holders who, adsdelphi@gmail.com I can reach us at e-mail address. Complaints considered to be infringing on the examination of the content will be removed from our site.

About us

  • 660 Pennsylvania Avenue Southeast #100 Washington, DC 20003
  • 0123456789
  • adsdelphi@gmail.com
  • Recent

  • Popular

  • Comments

  • How to add a server application written in UNIGUI to startup?

    By admin
    January 27, 2021
  • UniGUI Expiry Link Anonymizer

    By admin
    January 27, 2021
  • UniGUI Add CAPTCHA to the WEB project

    By admin
    January 26, 2021
  • UniGui. Unique hybrid of Delphi and JS

    By admin
    January 26, 2021
  • How to add a server application written in UNIGUI to startup?

    By admin
    January 27, 2021
  • Amazing Cross Platform Email App Sample In Delphi 10.4.1 FireMonkey For Android And IOS

    By admin
    August 13, 2020
  • Critical Update Available For Delphi FireMonkey 10.4.1 On Android, IOS, OSX, Windows, And Linux

    By admin
    September 4, 2020
  • Setting up the IDE for your first Android Application in Delphi

    By admin
    September 7, 2020

Follow us

Find us on Facebook

© Copyright Delphifan Forum. All rights reserved.