How to create alternating rows in the DataGridView?
|
Article Information
|
Article relates to VIBlend DataGridView for WinForms
|
How To
|
Apply different styles on alternating rows.
|
Solution
|
To achieve this, follow these steps:
|
1. Create a new instance of the vDataGridView via drag and drop from the toolbox or create it programmatically.
|
2. Bind the data grid to the Invoices table of the Northwind data base(NWind.mdb is shipped with the installation of the WinForms package)
|
|
3. Customize one of the built-in cell styles in order to set the cell's background color to be aqua.
|
|
4. Finally apply the cell style to the alternating grid rows.
|
|