You can use the DataRowTemplateStyles property or a StyleSheet to alternate the appearance of the DataRows.
Using the DataRowTemplatesStyles
gridControl1.DataRowTemplateStyles.Add( new VisualGridElementStyle() );
gridControl1.DataRowTemplateStyles.Add( new VisualGridElementStyle() );
gridControl1.DataRowTemplateStyles[ 0 ].BackColor = Color.Blue;
gridControl1.DataRowTemplateStyles[ 1 ].BackColor = Color.Red;
Using the StyleSheet
Dim styleSheet As New StyleSheet()
styleSheet.DataRows.Add(New VisualGridElementStyle())
styleSheet.DataRows.Add(New VisualGridElementStyle())
styleSheet.DataRows(0).BackColor = Color.Pink
styleSheet.DataRows(1).BackColor = Color.Green
‘ Don’t forget to call the grid’s ApplyStyleSheet
‘ method so that the new styles are reflected
‘ in the grid.
GridControl1.ApplyStyleSheet(styleSheet)
For more information, you can refer to theDataRowTemplate Stylestopic in the help file
Imported from legacy forums. Posted by Xceed admin (had 1885 views)