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

Total Post:119

Points:835
Posted on    September-03-2013 4:40 AM

 WPF WPF 
Ratings:


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

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

Any help will be appreciated. 



Sumit Kesarwani

Total Post:378

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