or
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using Telerik.WinControls.UI;namespace MenuMemoryLeak{ public partial class TestMdiParent : Telerik.WinControls.UI.RadForm { public TestMdiParent() { InitializeComponent(); } //NOTE this stuff with the backgroundworker is just to repeatedly close/open the form, I know it's not fully correct but the bug occurs nevertheless BackgroundWorker myWorker = new BackgroundWorker() { WorkerReportsProgress = true, WorkerSupportsCancellation = false }; TestMdiChild myMdiChild; private void TestMdiParent_Shown(object sender, EventArgs e) { myWorker.DoWork += delegate { int count = 0; while(true) { ++count; myWorker.ReportProgress(count); System.Threading.Thread.Sleep(1000); } }; myWorker.ProgressChanged += delegate { if(myMdiChild != null) { myMdiChild.Close(); System.GC.Collect(); } myMdiChild = new TestMdiChild() { MdiParent = this }; myMdiChild.Show(); }; myWorker.RunWorkerAsync(); } }}
TestMdiParent.Designer.csnamespace MenuMemoryLeak{ partial class TestMdiParent { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.testMenuItem = new Telerik.WinControls.UI.RadMenuItem(); this.testParentMenu = new Telerik.WinControls.UI.RadMenu(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.testParentMenu)).BeginInit(); this.SuspendLayout(); // // testMenuItem // this.testMenuItem.Name = "testMenuItem"; this.testMenuItem.Text = "Parent"; // // TestMdiParent // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(902, 523); // // testParentMenu // this.testParentMenu.Items.AddRange(new Telerik.WinControls.RadItem[] { this.testMenuItem}); this.testParentMenu.Location = new System.Drawing.Point(0, 0); this.testParentMenu.Name = "testParentMenu"; this.testParentMenu.Size = new System.Drawing.Size(902, 24); this.testParentMenu.TabIndex = 1; this.testParentMenu.Text = "radMenu1"; this.Controls.Add(this.testParentMenu); this.IsMdiContainer = true; this.Name = "TestMdiParent"; // // // this.RootElement.ApplyShapeToControl = true; this.Text = "TestMdiParent"; this.ThemeName = "ControlDefault"; this.Shown += new System.EventHandler(this.TestMdiParent_Shown); ((System.ComponentModel.ISupportInitialize)(this.testParentMenu)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private Telerik.WinControls.UI.RadMenuItem testMenuItem; private Telerik.WinControls.UI.RadMenu testParentMenu; }}using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using Telerik.WinControls;namespace MenuMemoryLeak{ public partial class TestMdiChild : Telerik.WinControls.UI.RadForm { public TestMdiChild() { InitializeComponent(); //NOTE required for bug to occur this.WindowState = FormWindowState.Maximized; } }}namespace MenuMemoryLeak{ partial class TestMdiChild { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.testMenuButtonItem = new Telerik.WinControls.UI.RadMenuButtonItem(); this.testChildMenu = new Telerik.WinControls.UI.RadMenu(); this.testTextBox = new Telerik.WinControls.UI.RadTextBox(); ((System.ComponentModel.ISupportInitialize)(this.testChildMenu)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.testTextBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); this.SuspendLayout(); // // testMenuButtonItem // this.testMenuButtonItem.Name = "testMenuButtonItem"; this.testMenuButtonItem.Text = "Child"; // // testChildMenu // this.testChildMenu.AllowMerge = false; this.testChildMenu.IsMainMenu = false; this.testChildMenu.Items.AddRange(new Telerik.WinControls.RadItem[] { this.testMenuButtonItem}); this.testChildMenu.Location = new System.Drawing.Point(0, 0); this.testChildMenu.Name = "testChildMenu"; this.testChildMenu.Size = new System.Drawing.Size(467, 24); this.testChildMenu.TabIndex = 2; this.testChildMenu.Text = "radMenu1"; // // testTextBox // this.testTextBox.Location = new System.Drawing.Point(22, 23); this.testTextBox.Name = "testTextBox"; this.testTextBox.Size = new System.Drawing.Size(100, 20); this.testTextBox.TabIndex = 1; this.testTextBox.TabStop = false; this.testTextBox.Text = "test"; // // TestMdiChild // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(467, 268); this.Controls.Add(this.testChildMenu); this.Controls.Add(this.testTextBox); this.Name = "TestMdiChild"; // // // this.RootElement.ApplyShapeToControl = true; this.Text = "TestMdiChild"; this.ThemeName = "ControlDefault"; ((System.ComponentModel.ISupportInitialize)(this.testChildMenu)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.testTextBox)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private Telerik.WinControls.UI.RadMenuButtonItem testMenuButtonItem; private Telerik.WinControls.UI.RadMenu testChildMenu; private Telerik.WinControls.UI.RadTextBox testTextBox; }}Hello,
We noticed the following problem with the RadGridView:
When you have Excel like filtering enabled, and you click on the filtering icon for a column that has duplicate decimal numbers, the app crashes with a message like this:
"Item has already been added. Key in dictionary: '26.7' Key being added: '26.7'"
Please find attached screenshots with grid of data and error message.
Configuration used:
Rad Controls for Win Forms 2010 Q3; WinXP, .NET 2.0, VB.NET
Here is the code that populates a test grid with data:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim rand As Random = New Random() Dim dt As DataTable = New DataTable() dt.Columns.Add("Pecentage", GetType(Double)) dt.Columns.Add("Price", GetType(Double)) For i As Integer = 1 To 10000 dt.Rows.Add(rand.Next(0, 100) + rand.Next(0, 100) * 0.1, rand.Next(0, 1000000)) Next grdData.DataSource = dt grdData.BestFitColumns()End SubThanks.