Datagrid editable


  • I can make my datagrid editable by setting IsReadOnly to False....

    But in my dataform I alos have AutoGenerateColumns set to false and specify specific fields I want to see....OUT of these fields I am specifying I only want to make 1 or 2 editable.

    How do I control and set specific fields in my datagrid to be editable?


     <data:DataGrid Name="dataGrid_Inspectors" MinHeight="100" IsReadOnly="True" Width="Auto" Height="600"        
         Margin="20,0,20,0"  ItemsSource="{Binding Data, ElementName=BusinessDataSource_Inspectors, Mode=TwoWay}"
         SelectionMode="Single" Visibility="Collapsed" AutoGenerateColumns="False"
             Header="FireDistrict" Width="Auto" Binding="{Binding FireDistrict}" />
             Header="BusinessName" Width="Auto" Binding="{Binding BusinessName}" />

    Friday, March 02, 2012 10:01 AM


All replies

  • Have you tried with the IsReadOnly property of DataGridTextColumn?

    Friday, March 02, 2012 11:37 AM
  • Thanks that was it....I tried that before and was getting an error...maybe I spelled it wrong or something...VS was not showing that as an option as well when typing it wasnt prompting me of that being an option..

    But working now...thanks

    Friday, March 02, 2012 11:52 AM