Home > DeveloperSection > Forums > WPF DataGrid: Make cells readonly
marcel ethan
marcel ethan

Total Post:105

Posted on    September-21-2013 7:34 AM


 1 Reply(s)
 1382  View(s)
Rate this:

I use the following DataGrid

<DataGrid Grid.Row="1" Grid.Column="1" Name="Grid" ItemsSource="{Binding}"  AutoGenerateColumns="False" >


                <DataGridTextColumn Header="Name" Width="100" Binding="{Binding Path=Name}"></DataGridTextColumn>

                <DataGridTextColumn Header="OldValue" Width="100" Binding="{Binding Path=OldValue}"></DataGridTextColumn>

                <DataGridTextColumn Header="NewValue" Width="100*" Binding="{Binding Path=NewValue}"></DataGridTextColumn>



How can I make the cells readonly?

Sumit Kesarwani

Total Post:378

Posted on    September-21-2013 8:04 AM

Hi Marcel,

Set DataGrid's IsReadOnly property to true.

<DataGrid Grid.Row="1" Grid.Column="1" Name="Grid" ItemsSource="{Binding}"

 IsReadOnly="True" AutoGenerateColumns="False" >

Don't want to miss updates? Please click the below button!

Follow MindStick