private void getfoodlist() { decimal max = 100.0M; decimal min = 0.0M; if (nUTR_DEFDataGrid.SelectedItem == null) { return; } DataRowView drv = nUTR_DEFDataGrid.SelectedItem as DataRowView; if (drv == null) { return; } SR25b.zsrDataSet.NUTR_DEFRow fr = (SR25b.zsrDataSet.NUTR_DEFRow)drv.Row; foo = (SR25b.zsrDataSet) this.FindResource("zsrDataSet"); decimal.TryParse(z_min.Text, out min); if (string.IsNullOrWhiteSpace(z_max.Text) == false) { decimal.TryParse(z_max.Text, out max); } // manually set the ItemsSource from the GetDataBy1 and use DefaultView. fOOD_DESDataGrid.ItemsSource = fdda.GetDataBy1(fr.Nutr_No, min, max).DefaultView; z_res.Content = string.Format(" Results, ( {0} Records Found )", fOOD_DESDataGrid.Items.Count); }
/// <summary> /// Fill The NUTR_DEF Datatable form ACCESS DB /// </summary> private void Nutdf() { foo = (SR25b.zsrDataSet) this.FindResource("zsrDataSet"); ndda.Fill(foo.NUTR_DEF); Dcvs = (CollectionViewSource)(this.FindResource("nUTR_DEFViewSource")); Dcvs.View.MoveCurrentToFirst(); }
private void ShowSelNut() { foo = (SR25b.zsrDataSet) this.FindResource("zsrDataSet"); //ndda.ClearBeforeFill = true; ndda.FillByselected(foo.NUTR_DEF); //ndda.ClearBeforeFill = false; Dcvs = (CollectionViewSource)(this.FindResource("nUTR_DEFViewSource")); Dcvs.View.MoveCurrentToFirst(); //MessageBox.Show(foo.NUTR_DEF.Rows.Count.ToString()); }
private void Foo2Vsrc() { foo = (SR25b.zsrDataSet) this.FindResource("zsrDataSet"); Fcvs = (CollectionViewSource)(this.FindResource("fD_GROUPFOOD_DESViewSource")); if (Fcvs != null && Fcvs.View != null) { Fcvs.View.MoveCurrentToFirst(); } }