Search Results

Search found 1 results on 1 pages for 'mastur cheef'.

Page 1/1 | 1 

  • Binding IsReadOnly using IValueConverter

    - by mastur cheef
    Maybe I'm misunderstanding how to use an IValueConverter or data binding (which is likely), but I am currently trying to set the IsReadOnly property of a DataGridTextColumn depending on the value of a string. Here is the XAML: <DataGridTextColumn Binding="{Binding Path=GroupDescription}" Header="Name" IsReadOnly="{Binding Current, Converter={StaticResource currentConverter}}"/> And here is my converter: public class CurrentConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string s = value as string; if (s == "Current") { return false; } else { return true; } } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotSupportedException(); } } Currently, the column is always editable, the converter seems to do nothing. Does anyone have some thoughts as to why this is happening?

    Read the article

1