Click here to Skip to main content
15,884,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have datagrid and have Radiobutton column. I want to cahnge the radio button color to Green if it is checked otherwise it should be Red. Please help me how to do this.

HTML
<DataGrid AutoGenerateColumns="False" Height="330" HorizontalAlignment="Left" Margin="5,50,0,0" Name="grdDeviceInfo" VerticalAlignment="Top"
                 CanUserAddRows="False" IsReadOnly="True" Width="270" HorizontalScrollBarVisibility="Auto">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Channels" Width="100" Binding="{Binding ChannelNo}"></DataGridTextColumn>
                    <DataGridTextColumn Header="Label" Width="100" Binding="{Binding Label}"></DataGridTextColumn>
                    <DataGridTemplateColumn Header="Status" Width="60">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <RadioButton HorizontalAlignment="Center" VerticalAlignment="Center"  IsEnabled="False" IsChecked="{Binding MasterStatus}" removed="#FFEB0F0F" Foreground="#FFC72B2B"></RadioButton>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </DataGrid>
Posted
Comments
Sinisa Hajnal 13-May-15 9:15am    
What have you tried? There are examples for javascript / jQuery and for server side handling easily found.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900