Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
I have a data grid with two columns .first column should be ready only in all condition its working,But second column read only field should work with a property it is not working

<DataGrid ItemsSource="{Binding DtFactor}"
   ColumnWidth="*"
   AutoGenerateColumns="False"
   CanUserAddRows="False"
   Visibility="{Binding Path= DtFactor,Converter={StaticResource DataGridVisibilityConvertercs}}">
                          
   <DataGrid.Columns >
      <DataGridTextColumn Header="Month"
         Binding="{Binding Path=Month}"
         IsReadOnly="True" />
      <DataGridTextColumn Header="Factor"
         Binding="{Binding Path=Factor}"
         IsReadOnly="{Binding IsDataGridEditable ,Converter={StaticResource IsDataGridEditable}}" />
   </DataGrid.Columns>
</DataGrid>


What I have tried:

i googled , but i didn't get any solution
Posted
Updated 9-Aug-17 22:51pm
v2

1 solution

You bound the second column to a property
IsDataGridEditable
You should use the debugger to find out what this property is set to in your ViewModel.

Moreover you have configured a value converter with the same name as your property.

Try to remove
Converter={StaticResource IsDataGridEditable}
from the binding.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900