Exception while using excel like filtering and using null and some other value for filter

4 posts, 0 answers
  1. Atiqul
    Atiqul avatar
    2 posts
    Member since:
    Mar 2015

    Posted 25 Apr Link to this post

    Hi,

    I am facing an exception when using excel-like filtering in RadGridView and use "Null" and some other value for filtering. The details is given below.

    My system information,

    • OS: Windows 7, 64 bit
    • IDE: Visual Studio 2013
    • Language: C#, .NET 4.5
    • Telerik version: 2016.1.216.40 (2016 Q1)
    • Telerik Runtime version: v4.0.30319

    Steps to reproduce the exception

    1. Create new Telerik Windows Forms Application
    2. Add Telerik.WinControls.GridView as reference
    3. In the generated RadForm add a RadGridView
    4. Add a text box column to the grid view
    5. Enable excel-like filtering in the grid view
      • radGridView1.EnableFiltering = true;
      • radGridView1.ShowFilteringRow = false;
      • radGridView1.ShowHeaderCellButtons = true;
    6. Run the project
    7. Add 4-5 rows with any values
    8. Edit at least one row, clear the value and press enter. This will make the value "Null" and "Null" will become available in filtering
    9. Press filter button and select "Null". This will uncheck all other filters
    10. Now check any other value excluding "Not Null"
    11. The exception is thrown, here's the stack trace -

    Item has already been added. Key in dictionary: 'value 1'  Key being added: 'value 1'
    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
       at System.Collections.Hashtable.Add(Object key, Object value)
       at Telerik.WinControls.UI.FilterMenuTreeElement.UpdateNodeSelectionOnCheckedChanged(RadTreeNode node)
       at Telerik.WinControls.UI.FilterMenuTreeElement.treeView_NodeCheckedChanged(Object sender, RadTreeViewEventArgs e)
       at Telerik.WinControls.UI.RadTreeViewElement.OnNodeCheckedChanged(TreeNodeCheckedEventArgs e)
       at Telerik.WinControls.UI.RadTreeNode.OnCheckStateChanged()
       at Telerik.WinControls.UI.RadTreeNode.set_CheckState(ToggleState value)
       at Telerik.WinControls.UI.TreeNodeElement.ToggleElement_ToggleStateChanging(Object sender, StateChangingEventArgs args)
       at Telerik.WinControls.UI.RadToggleButtonElement.OnToggleStateChanging(StateChangingEventArgs e)
       at Telerik.WinControls.UI.TreeNodeCheckBoxElement.OnToggleStateChanging(StateChangingEventArgs e)
       at Telerik.WinControls.UI.RadToggleButtonElement.SetToggleStateCore(ToggleState value)
       at Telerik.WinControls.UI.RadToggleButtonElement.SetToggleState(ToggleState value)
       at Telerik.WinControls.UI.TreeNodeCheckBoxElement.OnToggle()
       at Telerik.WinControls.UI.RadToggleButtonElement.OnClick(EventArgs e)
       at Telerik.WinControls.RadElement.DoClick(EventArgs e)
       at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
       at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
       at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
       at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
       at Telerik.WinControls.UI.RadTreeView.OnMouseUp(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at Telerik.WinControls.RadControl.WndProc(Message& m)
       at Telerik.WinControls.UI.RadTreeView.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at Telerik_GridView_Test.Program.Main() in d:\Projects\Zitter\Test Projects\Telerik GridView Test\Telerik GridView Test\Program.cs:line 17
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

     

    Looking forward to a quick solution for this.

    Thanks and Regards

  2. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 25 Apr Link to this post

    Hello Atiqul,

    Thank you for writing.

    It is a known issue when filtering null values. Here is the feedback item for your reference: http://feedback.telerik.com/Project/154/Feedback/Details/186484-fix-radgridview-argumentexception-in-excel-like-filtering-with-null-and-empty

    The fix will be introduced in the next official release which is scheduled for the beginning of May. Feel free use the suggested workaround in the feedback item.

    I hope this information helps. Should you have further questions I would be glad to help.

     Regards,
    Dess
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Atiqul
    Atiqul avatar
    2 posts
    Member since:
    Mar 2015

    Posted 25 Apr in reply to Dess Link to this post

    Hi Dess,

    Thanks a lot for your quick reply. I'll try the workaround suggested in the link you provided. Is it a  solid workaround, or is there any chance of this to get any other exception?

    Thanks

  5. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 25 Apr Link to this post

    Hello Atiqul,

    Thank you for writing back. 

    I am not familiar with the complete scenario on your end. However, the suggested workaround is not supposed to provoke any other exceptions. Feel free to try whether the solution suits your application. If you are experiencing any further difficulties, please let me know.

    Regards,
    Dess
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top