A draw grid (TDrawGrid) displays arbitrary data in tabular format. Write an OnDrawCell event handler to fill in the cells of the grid.
- The CellRect method returns the screen coordinates of a specified cell, while the MouseToCell method returns the column and row of the cell at specified screen coordinates. The Selection property indicates the boundaries of the currently selected cells.
- The TopRow property determines which row is currently at the top of the grid. The LeftCol property determines the first visible column on the left. VisibleColCount and VisibleRowCount are the number of columns and rows visible in the grid.
- You can change the width or height of a column or row with the ColWidths and RowHeights properties. Set the width of the grid lines with the GridLineWidth property. Add scroll bars to the grid with the ScrollBars property.
- You can choose to have fixed or non-scrolling columns and rows with the FixedCols and FixedRows properties. Assign a color to the fixed columns and rows with the FixedColor property.
- The Options, DefaultColWidth, and DefaultRowHeight properties also affect the appearance and behavior of the grid.