NextGrid & NextDBGrid








NextGrid .NET

Grid Report Tutorial

Related Articles:

  • Skill:
  • Version: 1.0.0
  • Author: Bojan Nikolic
  • Created: 2009-07-15
  • Updated: 2009-07-15
In this article we will explain how to work with Grid in Report Style. Report Style is default Grid Style.

1. Column Header

In Report View each Column have own Header.

Header may have: Title (Caption prop.), Image (Glyph prop.) and own Color.

Also, Column Header may be Left, Center or Right Aligned (Alignment prop.). If you want to show Hint Baloon, set Hint property. There is also Orientation property (Horizontal and Vertical).

If you want to detect when user click on Header, use OnHeaderClick event and simply read ACol parameter:

procedure TForm1.NextGrid1HeaderClick(Sender: TObject;
  ACol: Integer);

2. Input Line

When you want allow users to enter new values quickly into Grid, turn on Input Line. To show Input Line, set flag goInputLine in Options property to True.

Each column have own settings for InputLine. When you enter some text inside Input Line, property InputValue of Column will be set to this Value. If this property is empty, Grid may show grayed text inside Input Line (InputCaption prop.).

When user click somewhere else on Grid, or press Enter Key, values from Input Line will be added into new row.

To filter this values use OnInputAccept event:

procedure TForm1.NextGrid1InputAccept(Sender: TObject;
  var Accept: Boolean);
  if NextGrid1.Columns[0].InputValue = 'test'
    then NextGrid1.Columns[0].InputValue := 'Testing';
  if NextGrid1.Columns[1].InputValue = '' then
    ShowMessage('Value for Column 1 is empty');
    Accept := False; // <--- cancel adding new row

More info about using Input Line in InputLine Tutorial

3. Row Indicator

To turn on Grid Indicator, set goIndicator flag to True in Options property.

To enable Run-time Rows sizing, turn on goRowResizng flag inside Options property.

4. Column Footer

To turn on Grid Footer, set goFooter flag to True in Options property.

Similar to Column Header, Footer may have own Title (Caption property), Image (Glyph property) and Hint property.

There is also FormulaKind property which can be used for Column calculations. Supported formulas are: Min, Max, Count, Average, Distinct, Sum.

Was This Article Useful?

Only constructive comments, code contributions... will be publishes. Questions, non-official discussion will not be published.