This project has moved. For the latest updates, please go here.

Turning off alternating rows in Data Grid

Nov 28, 2013 at 12:14 AM
I'm trying to turn off the alternating lines.
I tried setting AlternationCount="0" but that had no effect. In fact I think AlternationCount is ignored as setting it to "3" still gave every other line alternating.
I also looked for an AlternateBackground property but there doesn't seem to be one. Setting the regular Background property sets the "dark" color in the alternating sequence but I can figure out a way to set the other color.

Any ideas or is this something that is only implemented in the Plus/Full WPF Grid?
Developer
Nov 28, 2013 at 3:28 PM
Hi,

The DataGrid can use a TableView or a TableflowView, default is TableflowView.
The TableView and TableflowView have a property called "IsAlternatingRowStyleEnabled".
By default, TableView.IsAlternatingRowStyleEnabled is False while TableflowView.IsAlternatingRowStyleEnabled is True.
You just need to set the value to False for the TableflowView:
 <xcdg:DataGridControl x:Name="_dataGrid">
            <xcdg:DataGridControl.View>
                <xcdg:TableflowView IsAlternatingRowStyleEnabled="False" />
            </xcdg:DataGridControl.View>
        </xcdg:DataGridControl>
Nov 28, 2013 at 7:20 PM
Thanks. That worked like a charm!