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›Add a column of record number to uniGUI’s table control uniDBGrid

Add a column of record number to uniGUI’s table control uniDBGrid

By admin
October 16, 2020
691
0
Share:

uniDBGrid is still very convenient to use, but it does not have the function of displaying the record number, so you must add it yourself. Refer to the solution given by foreigners as follows:

plan 1:

1- Create a first column in UniDBGrid (the column name starts with “NO”)

2- Add the following code under the UniDBGrid event DrawColumnCell

procedure ….Form.UniDBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
vDbGrid: TDBGrid absolute Sender;
begin

if DataCol=0 then
vDbGrid.Canvas.TextOut(Rect.Left + 2
, Rect.Top + 2
, IntToStr(vDbGrid.DataSource.DataSet.RecNo));
end;

Scenario 2:

    Add the following code under the ExtEvents event of UniDBGrid:

sender.headerCt.insert(0,new Ext.grid.RowNumberer({text:”,width:’auto’,align:’center’,menuDisabled:false}));

Below is the rendering

Tagsadd columndelphitable controlunidbgriduniguiunigui grid
Previous Article

Two ways to improve the efficiency of ...

Next Article

Good code samples for cxGrid

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

admin

Related articles More from author

  • CODE SAMPLESDELPHI

    Two Ways to Improve the Development Efficiency of Unigui in Delphi

    December 2, 2020
    By admin
  • CODE SAMPLESDELPHI

    UniGUI Add CAPTCHA to the WEB project

    January 26, 2021
    By admin
  • CODE SAMPLESDELPHI

    How to Remove Blank Lines from Memo?

    January 3, 2021
    By admin
  • CODE SAMPLESDELPHIFIREMONKEY

    Delphi changes Android brightness

    December 10, 2020
    By admin
  • CODE SAMPLESDELPHI

    Talk about the application of SSL protocol in Delphi [transfer]

    October 19, 2020
    By admin
  • DELPHIRELEASES

    Bold for Delphi is Open Source

    September 21, 2020
    By admin

Leave a reply Cancel reply

You may interested

  • CODE SAMPLESDELPHIFIREMONKEY

    Get device ID on Android from Delphi

  • DELPHIRELEASES

    Devart UniDAC 8.3.2 Release

  • CODE SAMPLESDELPHIFIREMONKEY

    Delphi Android permissions

  • 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.