views:

19

answers:

0

I would like to have the rows in a bound Silverlight grid act differently based on column values. Specifically, I need the following Grid to make a row inactive(read-only) and show up as a different color based on a column value

                    <data:DataGrid x:Name="griTemplate" Height="169" VerticalAlignment="Top">
                        <data:DataGrid.Columns>
                            <data:DataGridTextColumn Header="Step" Binding="{Binding StepNum}"/>
                            <data:DataGridTemplateColumn Header="Step Type" Width="80" CellTemplate="{StaticResource StepTypeTemplate}"/>
                            <data:DataGridTextColumn Header="Step Name" Width="170" Binding="{Binding Name}"/>
                            <data:DataGridTextColumn Header="Due" Width="50" Binding="{Binding DueAmount}"/>
                            <data:DataGridTextColumn Header="" Width="50" Binding="{Binding DueUnits}"/>
                            <!--<data:DataGridTextColumn Header="Skip" Width="50" Binding="{Binding SkipStep}"/>-->
                            <data:DataGridCheckBoxColumn Header="Skip" Width="50" Binding="{Binding SkipStep, Mode=TwoWay}"/>
                        </data:DataGrid.Columns>
                    </data:DataGrid>

Binding is (currently) simple:

griTemplate.ItemsSource = storage.WizRoute.Steps;

The field that contains the bool to show the row as active/inactive is not currently part of the grid; I assume I can add it as a hidden column. TIA.