Gridview Filter throws an error after changing theme dynamically

1 posts, 0 answers
  1. bala
    bala avatar
    3 posts
    Member since:
    Jul 2008

    Posted 19 Nov 2011 Link to this post

    Hi,

    I am using  telerik:StyleManager.Theme property in XAML to bind a theme to gridview dynamically.
     <telerik:RadGridView x:Name="grdTest" VerticalAlignment="Bottom" telerik:StyleManager.Theme="{Binding CurrentTheme, Mode=TwoWay}">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewColumn Header="test1" />
                            <telerik:GridViewColumn Header="test2" />
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
    There is a Button on the application to change the theme and when theme is changed, the value of the CurrentTheme property changed. Based on the new value gridview theme also changing properly, but the filter is not working, it throws an error in java script
    SCRIPT5022: Unhandled Error in Silverlight Application 
    Code: 4004    
    Category: ManagedRuntimeError       
    Message: System.ArgumentException: Value does not fall within the expected range.
       at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
       at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, DependencyObject doh)
       at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
       at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
       at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
       at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
       at System.Windows.Controls.ContentControl.set_Content(Object value)
       at Telerik.Windows.Controls.GridView.FilteringDropDown.OnIsDropDownOpenChanged(Boolean oldValue, Boolean newValue)
       at Telerik.Windows.Controls.GridView.FilteringDropDown.OnIsDropDownOpenChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
       at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
       at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.GridView.FilteringDropDown.set_IsDropDownOpen(Boolean value)
       at Telerik.Windows.Controls.GridView.FilteringDropDown.OnDropDownButtonClick(Object sender, RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Primitives.ToggleButton.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)     

    To repeat the scenario, follow the below steps:
    1)  on page load, click on the gridview filter 
    2) now change the theme
    3) then click on filter again, it throws an error

    When i use style manager to set the theme instead of telerik:StyleManager.Theme, it works fine.

    Can any one suggest how to resolve this issue.

    Thank you.

    Regards,
    Bala.
Back to Top