Click here to Skip to main content
15,908,841 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have Three column in datagrid out of which 2 are templated column with checkbox

XML
<wpf:DataGridTextColumn Binding="{Binding Path=Name}"  Header="Name Of Bank" />

                <wpf:DataGridTemplateColumn Width="SizeToHeader" IsReadOnly="True" Header="First Selection">
                    <wpf:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox IsChecked="{Binding Path=First}"  Checked="OnChecked" Margin="2,0,2,0" HorizontalAlignment="Center" VerticalAlignment="Stretch" />
                        </DataTemplate>
                    </wpf:DataGridTemplateColumn.CellTemplate>

                </wpf:DataGridTemplateColumn>
                <wpf:DataGridTemplateColumn Width="SizeToHeader" Header="Second Selection">
                    <wpf:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox IsChecked="{Binding Path=Second}" Checked="OnChecked" Margin="2,0,2,0" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </DataTemplate>
                    </wpf:DataGridTemplateColumn.CellTemplate>



what i want when i select the checkbox then the respective row and column should be disable to allow user to select only one value in each row and column. I got the index of column but i am not able to disable that column using
C#
Datagrid.Columns[1].IsReadOnly = true;

Help?
Posted
Updated 12-Aug-13 4:00am
v3
Comments
Raman Midha 12-Aug-13 10:09am    
what u updated in my question .. i am not able to find changes
idenizeni 12-Aug-13 12:39pm    
It just looks like your question was formatted so it looks better. It doesn't appear the content changed.

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