Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Expander > RadExpander binding is broken

Not answered RadExpander binding is broken

Feed from this thread
  • spj11 avatar

    Posted on Nov 3, 2011 (permalink)

    I have binded RadExpander to an ICommand implemetation in my VM

    <telerik:RadExpander Grid.Row="0" x:Name="radExpander" Collapsed="{Binding TreeUpdatedCommand}" 

    This breaks with the following exception:

    {System.ArgumentException: Object of type 'System.Windows.Data.Binding' cannot be converted to type 'Telerik.Windows.RadRoutedEventHandler'.
       at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
       at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
       at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at MS.Internal.XamlMemberInfo.SetValue(Object target, Object value)
       at MS.Internal.XamlManagedRuntimeRPInvokes.SetValue(XamlTypeToken inType, XamlQualifiedObject& inObj, XamlPropertyToken inProperty, XamlQualifiedObject& inValue)}

    Can you tell me if this is supported?

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Nov 8, 2011 (permalink)

    Hi Spj11,

     You cannot bind command to event directly. You can use MVVM Light ToolKit and its EventToCommandbehavior which allows you to bind an event to ICommand in XAML. Please let us know if you need further assistance on this.

    Kind regards,
    Petar Mladenov
    the Telerik team

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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Expander > RadExpander binding is broken
Related resources for "RadExpander binding is broken"

Silverlight Expander Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]