Home > DeveloperSection > Forums > How can I make the wpf datagrid cells readonly?
Goti Bandu

Total Post:119

Posted on    September-03-2013 4:40 AM


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

<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 cells readonly 

Any help will be appreciated. 

Sumit Kesarwani

Total Post:378

Posted on    September-03-2013 7:42 AM

Hi Goti,

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