Home Forums WPF controls Xceed DataGrid for WPF TwoWay binding , is not calling converback

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24985 |

    Hi,
    I have the following converter

    public class FormattingConverter: IValueConverter
    {
    public object Convert(object value, Type targetType,
    object parameter, System.Globalization.CultureInfo culture)
    {
    …………..
    }

    public object ConvertBack(object value, Type targetType,
    object parameter, System.Globalization.CultureInfo culture)
    {
    ….
    }
    }

    and i have the following DataTemplate

    <UIHelper:FormattingConverter x:Key=”formatter” />

    <DataTemplate x:Key=”percentageCellContentTemplate”>
    <TextBlock Text=”{Binding Mode=TwoWay, Path=., Converter={StaticResource formatter}, ConverterParameter=’ \{0:P\}’ }”/>
    </DataTemplate>

    and in the code i set the following

    grid.Columns[“Brokerage_Pct”].CellContentTemplate = this.FindResource(“percentageCellContentTemplate”) as DataTemplate;

    This calls the converters Convert but it is not calling the ConvertBack method at all

    how can i make this to call the converback method.

    regards

    Imported from legacy forums. Posted by sethu (had 517 views)

    User (Old forums)
    Member
    Post count: 23064

    TextBlock doesn’t allow user to edit the text. Why would you want it to call ConvertBack? It shouldn’t. ConvertBack will only be called if .Text property is modified.

    Imported from legacy forums. Posted by nat (had 2674 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.