RadMenu with DataBinding - convertes never called

2 posts, 0 answers
  1. Denis
    Denis avatar
    9 posts
    Member since:
    Jun 2012

    Posted 05 Apr 2012 Link to this post

    Hello, I have some template for cell in RadGridView:
    <DataTemplate x:Key="PropEditorSet">
        <telerik:RadMenu VerticalAlignment="Top" ItemsSource="{Binding Items}" Background="Transparent">
            <telerik:RadMenu.Resources>
                <SLAdmin:SetToStringConverter x:Key="setToStringConverter"/>
            </telerik:RadMenu.Resources>
            <telerik:RadMenu.ItemTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding ValueString, Mode=TwoWay, Converter={StaticResource setToStringConverter}}" Content="{Binding Name}" />
                </DataTemplate>                       
            </telerik:RadMenu.ItemTemplate>
        </telerik:RadMenu>
    </DataTemplate>

    I see unchecked checkboxes according to Items collection after binding.
    But my converter never called. Why converter never called and how I can use converter in this way? I want to use converter for processing state changes of checkboxes and pass one parameter (also using data binding) to converter.

    Converter code (if I uncomment Debugger.Break lines - nothing changes - debugger don't called)
    public class SetToStringConverter : IValueConverter
        {
            public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
            {
                //Debugger.Break();
                return true;
            }
     
            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
            {
                //Debugger.Break();
                return true;
            }
        }

    Thanks!
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 10 Apr 2012 Link to this post

    Hi,

     Converter will not be called if the binding is invalid. Please check your Visual Studio output window for more info about invalid bindings. 

    Regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top