In this tutorial, you will learn how to use the AlternatingRows property and built-in styles to apply alternating colors to grid rows to improve their readability.
1. Start with the project used in Tutorial 10 - Enhancing the User Interface with In-Cell Bitmaps.
2. In the Properties window, set the AlternatingRows property to True. The grid has default settings for both the EvenRow and OddRow styles. Use the default settings first and then change the settings for the EvenRowStyle.
Run the program and observe the following:
· C1TrueDBGrid1 displays data as in Tutorial 10 - Enhancing the User Interface with In-Cell Bitmaps except that even-numbered rows have a light cyan background.
3. Click on the ellipsis button next to the Styles property in the Properties window. This will bring up the C1TrueDBGrid Style Editor. Select the EvenRowStyle in the left pane, and in the right pane change its BackColor to LightGray. Click OK and close the editor.
Run the program and observe the following:
· C1TrueDBGrid1 displays data as in the previous figure, except that even-numbered rows now have a light gray background.
This concludes the tutorial.
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |