diff --git a/LibationWinForms/ProductsGrid.Designer.cs b/LibationWinForms/ProductsGrid.Designer.cs index 0a74a123..ce28cfdd 100644 --- a/LibationWinForms/ProductsGrid.Designer.cs +++ b/LibationWinForms/ProductsGrid.Designer.cs @@ -91,7 +91,7 @@ this.gridEntryDataGridView.ReadOnly = true; this.gridEntryDataGridView.RowHeadersVisible = false; this.gridEntryDataGridView.RowTemplate.Height = 82; - this.gridEntryDataGridView.Size = new System.Drawing.Size(1503, 380); + this.gridEntryDataGridView.Size = new System.Drawing.Size(1505, 380); this.gridEntryDataGridView.TabIndex = 0; // // dataGridViewImageButtonBoxColumn1 @@ -216,7 +216,7 @@ this.Controls.Add(this.gridEntryDataGridView); this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.Name = "ProductsGrid"; - this.Size = new System.Drawing.Size(1503, 380); + this.Size = new System.Drawing.Size(1505, 380); ((System.ComponentModel.ISupportInitialize)(this.gridEntryBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gridEntryDataGridView)).EndInit(); this.ResumeLayout(false); diff --git a/LibationWinForms/SortableBindingList2[T].cs b/LibationWinForms/SortableBindingList2[T].cs index 1a0e1d97..0a2bf465 100644 --- a/LibationWinForms/SortableBindingList2[T].cs +++ b/LibationWinForms/SortableBindingList2[T].cs @@ -36,7 +36,11 @@ namespace LibationWinForms Comparer.PropertyName = property.Name; Comparer.Direction = direction; - itemsList.Sort(Comparer); + //Array.Sort and Liat.Sort are unstable sorts. OrderBy is stable. + var sortedItems = itemsList.OrderBy((ge) => ge, Comparer).ToArray(); + + itemsList.Clear(); + itemsList.AddRange(sortedItems); propertyDescriptor = property; listSortDirection = direction;