Hi all,
Version: 10.3.20103.1000
A have a UltraTree bound to a BindingList<T>. If I remove the last item from the binding list to create an empty list, then the tree control throws the following exception.
Infragistics2.Win.UltraWinTree.v10.3.dll!Infragistics.Win.UltraWinTree.TreeNodesCollection.GetNodeFromListIndex(int listIndex = 0) + 0x23 bytes Infragistics2.Win.UltraWinTree.v10.3.dll!Infragistics.Win.UltraWinTree.TreeNodesCollection.dataList_ItemDeleted(System.ComponentModel.ListChangedEventArgs e) + 0x15 bytes Infragistics2.Win.UltraWinTree.v10.3.dll!Infragistics.Win.UltraWinTree.TreeNodesCollection.dataList_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e) + 0x2a bytes UltraTreeBinding.exe!UltraTreeBinding.Form1.Button1Click(object sender = {Text = "Remove Node"}, System.EventArgs e = {X = 49 Y = 8 Button = Left}) Line 58 + 0x12 bytes C#
If I replace the final Remove with a Clear(), then everything works fine. Can you take a look to see if this is a bug in the tree control?
Thanks
Steve
Sample code:
using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; namespace UltraTreeBinding { public partial class Form1 : Form { private readonly BindingList dataSource = new BindingList(); private Infragistics.Win.UltraWinTree.UltraTree ultraTree1; private Button button1; /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { ultraTree1 = new Infragistics.Win.UltraWinTree.UltraTree(); button1 = new Button(); ((ISupportInitialize)(ultraTree1)).BeginInit(); SuspendLayout(); // ultraTree1 ultraTree1.Dock = DockStyle.Top; ultraTree1.Size = new Size(550, 350); ultraTree1.Name = "ultraTree1"; // button1 button1.Location = new Point(13, 370); button1.Size = new Size(75, 23); button1.Text = @"Remove Node"; button1.Click += Button1Click; // Form1 AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(551, 411); Controls.Add(button1); Controls.Add(ultraTree1); ((ISupportInitialize)(ultraTree1)).EndInit(); ResumeLayout(false); } public Form1() { InitializeComponent(); dataSource.Add("Node 1"); dataSource.Add("Node 2"); ultraTree1.DataSource = dataSource; } private void Button1Click(object sender, EventArgs e) { dataSource.RemoveAt(0); } } }
Hello, Thanks for cheking up.
Alas at this moment in time were not able to upgrade the version of infragistics we are using as we dont have time to test for any potential regresisons etc., so have had to work around (using Clean if removing the last item). Hoping to upgrade at the start of the next cycle.
I will let you know what happens.
Hello Steven,
I wanted to know if you were able to solve your issue based on these suggestions or you still need help. Please let me know.
Thanks Boris, much appreciated. I will give that a try.
Hello,
This seems to be an issue which has already been fixed. So what you could do is to download the latest service release available for your current version or either download the trial version of Net Advantage 11.2 and test your application against it.
Please do not hesitate to contact us if you need any additional assistance.