title: How to enable a datagrid column text in C#/ wpf
body: <p>I have an app in which as soon as I click the "Insert" I want the program to enable the text in data grid and the user can enter the information of the product. Can someone help me with how can I do this? </p>
  
  <p>below the app code and picture</p>
  
  <p><a href="https://i.stack.imgur.com/vvUyf.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <pre><code>&lt;Window&gt;
      &lt;Grid&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
              &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
              &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
              &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto"&gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto"&gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto"&gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition Height="Auto"&gt;&lt;/RowDefinition&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;TextBlock Grid.Row="0" Grid.Column="0" FontWeight="Bold" HorizontalAlignment="Center"&gt;Produtos&lt;/TextBlock&gt;
          &lt;TextBlock Grid.Row="0" Grid.Column="1" FontWeight="Bold" HorizontalAlignment="Center"&gt;Unidades&lt;/TextBlock&gt;
          &lt;TextBlock Grid.Row="0" Grid.Column="2" FontWeight="Bold" HorizontalAlignment="Center"&gt;Empresas&lt;/TextBlock&gt;
          &lt;TextBlock Grid.Row="0" Grid.Column="3" FontWeight="Bold" HorizontalAlignment="Center"&gt;Operadores&lt;/TextBlock&gt;
          &lt;DataGrid Grid.Row="1" Grid.Column="0" CanUserAddRows="False" CanUserDeleteRows="False" Margin="5" ItemsSource="{Binding ListaProdutos}" AutoGenerateColumns="False" SelectedItem="{Binding ProdutoSelecionado}"&gt;
              &lt;DataGrid.Columns&gt;
                  &lt;DataGridTextColumn Header="Descrição" Binding="{Binding Descricao, UpdateSourceTrigger=PropertyChanged}" Width="*"&gt;&lt;/DataGridTextColumn&gt;
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
          &lt;DataGrid Grid.Row="1" Grid.Column="1" CanUserAddRows="False" CanUserDeleteRows="False" Margin="5" ItemsSource="{Binding ListaUnidades}" AutoGenerateColumns="False" SelectedItem="{Binding UnidadeSelecionada}"&gt;
              &lt;DataGrid.Columns&gt;
                  &lt;DataGridTextColumn Header="Descrição" Binding="{Binding Descricao, UpdateSourceTrigger=PropertyChanged}" Width="*"&gt;&lt;/DataGridTextColumn&gt;
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
          &lt;DataGrid Grid.Row="1" Grid.Column="2" CanUserAddRows="False" CanUserDeleteRows="False" Margin="5" ItemsSource="{Binding ListaEmpresas}" AutoGenerateColumns="False" SelectedItem="{Binding EmpresaSelecionada}"&gt;
              &lt;DataGrid.Columns&gt;
                  &lt;DataGridTextColumn Header="Descrição" Binding="{Binding Descricao, UpdateSourceTrigger=PropertyChanged}" Width="*"&gt;&lt;/DataGridTextColumn&gt;
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
          &lt;DataGrid Grid.Row="1" Grid.Column="3" CanUserAddRows="False" CanUserDeleteRows="False" Margin="5" ItemsSource="{Binding ListaOperadores}" AutoGenerateColumns="False" SelectedItem="{Binding OperadorSelecionado}"&gt;
              &lt;DataGrid.Columns&gt;
                  &lt;DataGridTextColumn Header="Nome" Binding="{Binding Nome, UpdateSourceTrigger=PropertyChanged}" Width="*"&gt;&lt;/DataGridTextColumn&gt;
              &lt;/DataGrid.Columns&gt;
          &lt;/DataGrid&gt;
          &lt;StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Center"&gt;
              &lt;Button Command="{Binding InserirProdutoCommand}" Width="50" Height="25"&gt;Inserir&lt;/Button&gt;
              &lt;Button Command="{Binding ExcluirProdutoCommand}" Width="50" Height="25"&gt;Excluir&lt;/Button&gt;
          &lt;/StackPanel&gt;
          &lt;StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center"&gt;
              &lt;Button Command="{Binding InserirUnidadeCommand}" Width="50" Height="25"&gt;Inserir&lt;/Button&gt;
              &lt;Button Command="{Binding ExcluirUnidadeCommand}" Width="50" Height="25"&gt;Excluir&lt;/Button&gt;
          &lt;/StackPanel&gt;
          &lt;StackPanel Grid.Row="2" Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Center"&gt;
              &lt;Button Command="{Binding InserirEmpresaCommand}" Width="50" Height="25"&gt;Inserir&lt;/Button&gt;
              &lt;Button Command="{Binding ExcluirEmpresaCommand}" Width="50" Height="25"&gt;Excluir&lt;/Button&gt;
          &lt;/StackPanel&gt;
          &lt;StackPanel Grid.Row="2" Grid.Column="3" Orientation="Horizontal" HorizontalAlignment="Center"&gt;
              &lt;Button Command="{Binding InserirOperadorCommand}" Width="50" Height="25" HorizontalAlignment="Center"&gt;Inserir&lt;/Button&gt;
              &lt;Button Command="{Binding ExcluirOperadorCommand}" Width="50" Height="25" HorizontalAlignment="Center"&gt;Excluir&lt;/Button&gt;
          &lt;/StackPanel&gt;
          &lt;Border Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="4" BorderThickness="0 1 0 0" BorderBrush="Gray" Margin="10,10,5,0" Padding="5 5 5 0" VerticalAlignment="Top" Height="46"&gt;
              &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right"&gt;
                  &lt;Button Command="{Binding SalvarCommand}" Width="80" Height="30"&gt;Salvar&lt;/Button&gt;
                  &lt;Button Command="{Binding CancelarCommand}" Width="80" Height="30"&gt;Cancelar&lt;/Button&gt;
              &lt;/StackPanel&gt;
          &lt;/Border&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>