title: WPF Datagrid edit only single cell value
body: <p>I have a WPF Datagrid with 2 columns say parametername and value.</p>
  
  <p>My Requirement is only one value(cell content) for a Particular parametername should be editable and the entire Datagrid contents should be read only....</p>
  
  <p>And I have a save button to save the values.</p>
  
  <p>I had been researching from couple of days for an appropriate solution which observes to be a common requirement in many cases but I havent found...</p>
  
  <p>Please any solution or ideas will be appreciated..</p>
  
  <p>Here is XAML &amp; cs : When the Datagrid loads I want only the PM2 cell value to be in edit mode and all other datagrid content should be greyed out or non-editable..</p>
  
  <hr>
  
  <pre><code>&lt;Grid&gt;
      &lt;DataGrid ItemsSource="{Binding}"  AutoGenerateColumns="False"
                       Margin="20,57,18,19" Name="dataGrid1" 
                        Height="250" SelectionUnit="Cell" &gt;
  
       &lt;DataGrid.Columns&gt;
       &lt;DataGridTextColumn Binding="{Binding ParameterName}" Width="100"  Header="Parameter     Name"   IsReadOnly="True"/&gt;
  
           &lt;DataGridTextColumn Binding="{Binding Value}" Width="100"  Header="Value" /&gt;
  
          &lt;/DataGrid.Columns&gt;
  
      &lt;/DataGrid&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <hr>
  
  <p>And my CS code</p>
  
  <pre><code>public partial class dgSF : Window
  {
  
  ObservableCollection&lt;ParameterSet&gt; pmset;
  
      public dgSF()
      {
          InitializeComponent();
          pmset = new ObservableCollection&lt;ParameterSet&gt;();
  
          pmset.Add(new ParameterSet() { ParameterName = "PM1", Value = 10 });
  
          pmset.Add(new ParameterSet() { ParameterName = "PM2", Value = 50 });
  
          pmset.Add(new ParameterSet() { ParameterName = "PM3", Value = 70 });
  
          pmset.Add(new ParameterSet() { ParameterName = "PM4", Value = 80 });
  
          pmset.Add(new ParameterSet() { ParameterName = "PM5", Value = 100 });
  
          dataGrid1.ItemsSource = pmset;
      }
  }
  
  public class ParameterSet
  {
  
      public string ParameterName { get; set; }
  
      public int Value { get; set; }
  
  }
  </code></pre>
  
  <p>Thanks So much,</p>
  
  <p>Anu</p>