This is a migrated thread and some comments may be shown as answers.

RadMenu with DataBinding - convertes never called

1 Answer 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Denis
Top achievements
Rank 1
Denis asked on 05 Apr 2012, 06:20 AM
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!

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 10 Apr 2012, 06:49 AM
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 >>

Tags
General Discussions
Asked by
Denis
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or