private void ShowTrajButton_Clicked(object sender, RoutedEventArgs e) { int tid = 0; if (tds != null) { singletrajectory.Children.Clear(); clearTrajectoryText(); //Draw Trajectory if (int.TryParse(tidtextblock.Text, out tid) && tds.trajectories.FindByt_id(tid) != null) { DrawTrajectory(tid, Colors.Red, "N", singletrajectory); updateTrajectoryText(tid); //highlightRow(tid); } //Open Point Window if (int.TryParse(tidtextblock.Text, out tid)) { pw = new PointsWindow(); pw.Show(); TrajectoryDbDataSet.pointsRow[] rows = tds.points.Select(string.Format("t_id={0}", tid)) as TrajectoryDbDataSet.pointsRow[]; if (rows != null) { BindingListCollectionView view = CollectionViewSource.GetDefaultView(rows) as BindingListCollectionView; pw.pointsDg.ItemsSource = rows; } //highlightRow(tid); } } }