DataGridView: IDataGridView;
The DataGridView property returns the component table view.
Executing the example requires that the repository contains a web form, the Button1 button on the form, and the DataGridView component named DataGridView1. A data source is connected to the DataGridView1 component.
Add links to the Express, Tab, and WebForms system assemblies.
Class TESTWebForm: WebForm
Button1: WebButton;
DataGridView1: WebDataGridView;
Sub Button1OnClick;
Var
DGView: IDataGridView;
Columns: IGridViewColumns;
Column: IGridViewColumn;
Style: ITabCellStyle;
i, c: Integer;
Begin
DGView := DataGridView1.DataGridView;
DGView.BeginUpdate;
Columns := DGView.Columns;
c := Columns.Count;
For i := 0 To c - 1 do
Column := Columns.Item(i);
// Title style
Style := Column.HeaderStyle;
Style.HorizontalAlignment := TabFormatAlignment.Center;
Style.VerticalAlignment := TabFormatLayout.Center;
// Data style
Style := Column.DataStyle;
Style.Font.Italic := TriState.OnOption;
End For;
DGView.TableStyle := TabTablePredefinedStyle.Orange;
DGView.EndUpdate;
End Sub Button1OnClick;
End Class TESTWebForm;
Clicking the button will change formatting settings of table title, data area, and will set the orange alternating style.
See also: