NiceGrid

This is an old revision of NiceGrid, edited by Wp at . The current revision is 147391.

More on Download

The following text is based on the readme.html file which is in the NiceGrid installation directory. It is written by the original author of the component, Priyatna. The text is also available on the author's web site which, however, is not available any more.

Introduction

NiceGrid is a Delphi and Lazarus component that is aimed to be a standard string grid replacement. It is written from scratch, not descending from TStringGrid. The main reason why I wrote this component is to have a grid component that is nice and smooth. Here's some feature of NiceGrid:

Since it is a new component, there are several main differences between TNiceGrid and TStringGrid:

License

This library is released under Mozilla Public License. You can use it in your freeware, shareware or commercial softwares. You can send your modification to me, and if I decide to include it in the main distribution, I will add your name as a contributor. You can read full licensing information in the file "License.txt" in the NiceGrid installation folder.

Version History

Version 3.0

Version 2.2

Version 2.1

Version 2.0

Download and installation

The easiest way for Lazarus users is to get the package from the Online Package Manager (OPM) which is installed with newer Lazarus versions. Simply open its menu item, check "NiceGrid" in the tree list, and click "Install". Then OPM will take care of the download and the installation.

Since the OPM version may not always be up-to-date, you can also download the development version from the "Lazarus Component and Code Repository" (CCR) where a zipped snapshot is provided (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/nicegrid/). Alternatively, if you use SVN you can use the following SVN command in a console window:

svn checkout svn://svn.code.sf.net/p/lazarus-ccr/svn/components/nicegrid nicegrid

This applies also for Delphi users.

In Lazarus, open the NiceGridLaz.lpk file in the package editor ("Package" > "Open Package File (.lpk)", click "Use" > "Install", and let the IDE recompile itself.

In Delphi, open NiceGridD7.dpk in the IDE and press the Install button. Another package is provided in the download for newer Delphi versions, named NiceGridXE11; although tested under Delphi XE11 (Alexandria) it should work other Delphi versions as well.

The component will appear on the priyatna.org palette tab.

Working with Headers

All features explained below are available at design time, but I will cover it using codes, for easy following.

NiceGrid will automatically scan the column title and make appropriate merging and multi-lining. The only thing you must do is setting each column's Title property. This is a string type property. To make a multi-lined caption, use ';' (semicolon) character.

For example:

NiceGrid1.Columns[0].Title := 'First Line;Second Line';

will make

First Line Second Line

The HeaderLine property determines how many lines will be allocated for headers. Each line in headers can be set also via column's Title property, separated by '|' character.

For example:

NiceGrid1.HeaderLine := 2;
NiceGrid1.Columns[0].Title := 'First Line|Second Line';

will make

First Line
Second Line

To merge two header cells, set each cell to exactly the same value, including ';' characters if they are multi-lined.

For example:

NiceGrid1.HeaderLine := 2;
NiceGrid1.ColCount := 2;
NiceGrid1.Columns[0].Title := 'One|Two';
NiceGrid1.Columns[1].Title := 'One|Three';

will make

One
Two Three

Using a combination of '|' and ';' characters, we can make a complex header.

For example:

NiceGrid1.HeaderLine := 2;
NiceGrid1.ColCount := 5;
NiceGrid1.Columns[0].Title := 'Merged;Multilined|Merged;Multilined';
NiceGrid1.Columns[1].Title := 'First Group|One';
NiceGrid1.Columns[2].Title := 'First Group|Two';
NiceGrid1.Columns[3].Title := 'Second Group|Three';
NiceGrid1.Columns[4].Title := 'Second Group|Four';

will make

Merged
Multilined
FirstGroup SecondGroup
One Two Three Four

Contacts

Don't hesitate to report any bug or whish to me:

Priyatna Bandung - Indonesia

http://www.priyatna.org/

mailto:me@priyatna.org

The http address is no longer available. You may report bugs also in the Lazarus bug tracker for the CCR project