Skip to content

Commit f04482c

Browse files
committed
Aktualsierungen werden nach Datum sortiert angezeigt
1 parent 0efb793 commit f04482c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ChartButlerCS/frmChartDB.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,12 @@ private void updateTreeView()
183183
updatesNode.NodeFont = new Font(treeView1.Font, FontStyle.Bold);
184184
treeView1.Nodes.Add(updatesNode);
185185
updatesNode.Text = "Aktualisierungen";
186+
using (BindingSource updatesBindingSource = new BindingSource(chartButlerDataSet, "Updates"))
186187
{
187-
// von neu (unten in der Tabelle) nach alt durchgehen
188-
for (int updidx= chartButlerDataSet.Updates.Count - 1; updidx>=0; --updidx)
188+
updatesBindingSource.Sort = "Date";
189+
for (int updidx = updatesBindingSource.Count - 1; updidx >= 0; --updidx)
189190
{
190-
ChartButlerDataSet.UpdatesRow updrow = chartButlerDataSet.Updates[updidx];
191+
ChartButlerDataSet.UpdatesRow updrow = (ChartButlerDataSet.UpdatesRow)((DataRowView)updatesBindingSource[updidx]).Row;
191192
TreeNode updNode = new TreeNode(updrow.Date.ToShortDateString());
192193
updNode.Tag = updrow;
193194

@@ -200,7 +201,7 @@ private void updateTreeView()
200201
ChartButlerDataSet.AFChartsRow chartrow = (ChartButlerDataSet.AFChartsRow)((DataRowView)chartsBindingSource[chartidx]).Row;
201202
updNode.Nodes.Add(chartrow.Cname).Tag = chartrow;
202203
}
203-
if (updNode.Nodes.Count != 0)
204+
if (updNode.Nodes.Count != 0)
204205
updatesNode.Nodes.Add(updNode);
205206
chartsBindingSource.Dispose();
206207
}

0 commit comments

Comments
 (0)