I wrote the below code in wpf datagrid
<DataGridTextColumn Binding="{Binding comments}" Width="350" Header="Comments" IsReadOnly="False" >
<DataGridTextColumn.ElementStyle>
<Style>
<Setter Property="TextBlock.TextWrapping" Value="Wrap" />
<Setter Property="TextBlock.TextAlignment" Value="Left"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
And getting the error below, but the grid is working fine. Can anyone please help me to identify why I am getting the below error.
System.Windows.Data Error: 40 : BindingExpression path error: 'comments' property not found on 'object' ''DataRowView' (HashCode=43816328)'. BindingExpression:Path=comments; DataItem='DataRowView' (HashCode=43816328); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')