diff --git a/CoordinateConverter/DCS/Tools/FormUnitImporter.cs b/CoordinateConverter/DCS/Tools/FormUnitImporter.cs index 93b221e..07c24eb 100644 --- a/CoordinateConverter/DCS/Tools/FormUnitImporter.cs +++ b/CoordinateConverter/DCS/Tools/FormUnitImporter.cs @@ -232,7 +232,7 @@ private enum EDGVColumnHeaders { ID, Coalition, - Type, + TypeName, TypeL1, TypeL2, TypeL3, @@ -252,7 +252,7 @@ private void InitCurrentView() currentView.Columns.Add(EDGVColumnHeaders.ID.ToString(), typeof(int)); currentView.Columns.Add(EDGVColumnHeaders.Coalition.ToString(), typeof(string)); - currentView.Columns.Add(EDGVColumnHeaders.Type.ToString(), typeof(string)); + currentView.Columns.Add(EDGVColumnHeaders.TypeName.ToString(), typeof(string)); currentView.Columns.Add(EDGVColumnHeaders.Class.ToString(), typeof(string)); currentView.Columns.Add(EDGVColumnHeaders.TypeL1.ToString(), typeof(int)); currentView.Columns.Add(EDGVColumnHeaders.TypeL2.ToString(), typeof(int)); @@ -325,7 +325,7 @@ public FormUnitImporter(List referencePoints) // This binds the existing columns to the data properties in the data view dgv_Units.Columns["dgvColId"].DataPropertyName = EDGVColumnHeaders.ID.ToString(); dgv_Units.Columns["dgvColCoalition"].DataPropertyName = EDGVColumnHeaders.Coalition.ToString(); - dgv_Units.Columns["dgvColTypeName"].DataPropertyName = EDGVColumnHeaders.Type.ToString(); + dgv_Units.Columns["dgvColTypeName"].DataPropertyName = EDGVColumnHeaders.TypeName.ToString(); dgv_Units.Columns["dgvColClass"].DataPropertyName = EDGVColumnHeaders.Class.ToString(); dgv_Units.Columns["dgvColUnitName"].DataPropertyName = EDGVColumnHeaders.Name.ToString(); dgv_Units.Columns["dgvColPosition"].DataPropertyName = EDGVColumnHeaders.Position.ToString(); @@ -444,25 +444,26 @@ private void Dgv_Units_ColumnHeaderMouseClick(object sender, DataGridViewCellMou System.ComponentModel.ListSortDirection direction; if (dgv_Units.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection == SortOrder.Ascending) { - direction = System.ComponentModel.ListSortDirection.Descending; - dgv_Units.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = SortOrder.Descending; (dgv_Units.DataSource as DataView).Sort = $"{EDGVColumnHeaders.TypeL1} DESC," + $"{EDGVColumnHeaders.TypeL2} DESC," + $"{EDGVColumnHeaders.TypeL3} DESC," + - $"{EDGVColumnHeaders.TypeL4} DESC"; + $"{EDGVColumnHeaders.TypeL4} DESC," + + $"{EDGVColumnHeaders.TypeName} DESC," + + $"{EDGVColumnHeaders.RNG} ASC"; + dgv_Units.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = SortOrder.Descending; } else { - direction = System.ComponentModel.ListSortDirection.Ascending; - dgv_Units.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = SortOrder.Ascending; (dgv_Units.DataSource as DataView).Sort = $"{EDGVColumnHeaders.TypeL1} ASC," + $"{EDGVColumnHeaders.TypeL2} ASC," + $"{EDGVColumnHeaders.TypeL3} ASC," + - $"{EDGVColumnHeaders.TypeL4} ASC"; + $"{EDGVColumnHeaders.TypeL4} ASC," + + $"{EDGVColumnHeaders.TypeName} ASC," + + $"{EDGVColumnHeaders.RNG} ASC"; + dgv_Units.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = SortOrder.Ascending; } - dgv_Units.Sort(dgv_Units.Columns[e.ColumnIndex], direction); break; default: break; diff --git a/CoordinateConverter/todo.txt b/CoordinateConverter/todo.txt index fcdb24c..b530ff6 100644 --- a/CoordinateConverter/todo.txt +++ b/CoordinateConverter/todo.txt @@ -1,5 +1,4 @@ Unit list: - - Fix unit sorting - Filter by unit type/name FIXME: