Grid rows

This guide covers grid rows functions. They allow you to define how rows should be structured, including horizontal grid, vertical grid and row coloring. The rows can be colored in three different schemes: even, odd or no coloring at all. It is simple and easy just use one of the inputs in the <gui-grid> selector. Row coloring can be specified as a string ('odd') or an enum (GuiRowColoring.ODD). See the 'Grid rows' tab below.


Grid rows
rowColoring: string
rowColoring: GuiRowColoring
horizontalGrid: boolean;

verticalGrid: boolean;

rowColoring: string | GuiRowColoring;
rowColoring = 'none'

rowColoring = 'odd'

rowColoring = 'even'
rowColoring: GuiRowColoring = GuiRowColoring.NONE

rowColoring: GuiRowColoring = GuiRowColoring.ODD

rowColoring: GuiRowColoring = GuiRowColoring.EVEN


On the example below you can check following functions:

  • Horizontal grid
  • Vertical grid
  • Row coloring:
    • None
    • Odd
    • Even

Rows example
app.component.html
app.component.ts
Number
Name
Position
Team
8 Kobe BryantSG Los Angeles Lakers 1 Tracy McGradySG Houston Rockets 23 Lebron JamesPF Los Angeles Lakers 3 Dwayne WadeSG Miami Heat 15 Vince CarterSG Atlanta Hawks 34 Charles BarkleyPF N/A 15 Nikola JokićPF Denver Nuggets 0 Russell WestbrookPG Houston Rockets 7 Kevin DurantPF Brooklyn Nets 13 James HardenPG/SG Houston Rockets 13 Paul GeorgeSG Los Angeles Clippers 25 Ben SimmonsPG Philadelphia 76ers 2 Kawhi LeonardSG/SF Los Angeles Clippers 21 Joel EmbiidC Philadelphia 76ers 34 Giannis AntetokounmpoPF Milwaukee Bucks 30 Stephen CurryPG Golden State Warriors 11 Klay ThompsonSG Golden State Warriors 23 Anthony DavisPF Los Angeles Lakers
<gui-grid [source]="source"
		  [columns]="columns"
		  [rowColoring]="rowColoring"
		  [horizontalGrid]="horizontalGrid"
		  [verticalGrid]="verticalGrid">
</gui-grid>
import { Component } from '@angular/core';
import { source } from './source';
import { GuiCellView, GuiRowColoring } from '@generic-ui/ngx-grid';

@Component({
	selector: 'docs-row-grid',
	templateUrl: './docs-row-grid.component.html'
})
export class DocsRowGridComponent {

	horizontalGrid: boolean = true;

	verticalGrid: boolean = true;

	rowColoring: GuiRowColoring = GuiRowColoring.NONE;

	columns = [{
		header: 'Number',
		field: 'number',
		width: 60
	}, {
		header: 'Name',
		field: 'name',
		view: GuiCellView.ITALIC
	}, {
		header: 'Position',
		field: 'position',
		view: GuiCellView.BOLD
	}, {
		header: 'Team',
		field: 'team'
	}];

	source = source;
}


Inputs

InputTypeDefault valueDescription
horizontalGridbooleantrue Enables horizontal lines that separate rows within the grid.
verticalGridbooleantrue Enables vertical lines that separate columns within the grid.
rowColoringstring | GuiRowColoringGuiRowColoring.EVENApplies colored shading to the grid rows. Available shading options: even, odd, none.

Related articles:

We use cookies to improve your experience. If you continue browsing, we assume that you consent to our use of cookies.