Changed sort method.
This commit is contained in:
parent
d48bd5ad07
commit
5f8ca9a0b5
4
LibationWinForms/ProductsGrid.Designer.cs
generated
4
LibationWinForms/ProductsGrid.Designer.cs
generated
@ -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);
|
||||
|
||||
@ -36,7 +36,11 @@ namespace LibationWinForms
|
||||
Comparer.PropertyName = property.Name;
|
||||
Comparer.Direction = direction;
|
||||
|
||||
itemsList.Sort(Comparer);
|
||||
//Array.Sort and Liat<T>.Sort are unstable sorts. OrderBy is stable.
|
||||
var sortedItems = itemsList.OrderBy((ge) => ge, Comparer).ToArray();
|
||||
|
||||
itemsList.Clear();
|
||||
itemsList.AddRange(sortedItems);
|
||||
|
||||
propertyDescriptor = property;
|
||||
listSortDirection = direction;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user