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

Total Post:105

Points:735
Posted on    September-21-2013 7:34 AM

 WPF WPF 
Ratings:


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

I use the following DataGrid

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

            <DataGrid.Columns>

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

            </DataGrid.Columns>

        </DataGrid>

How can I make the cells readonly?



Sumit Kesarwani

Total Post:378

Points:2694
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