private void LoadRdg() { if (Tempres == null || Tempres.Count <= 0) { return; } NUTR_DEF nd = (NUTR_DEF)ResList.SelectedItem; if (nd == null) { return; } short decp = nd.Num_Dec; var tisqry = Tempres.Where(n => n.Nutr_No == nd.Nutr_No).ToList <NUT_DATA>(); string selection = string.Format("{0} Records found for {1}.", tisqry.Count(), nd.NutrDesc); ResGridHead.Content = selection; PanRes.Rows.Clear(); ResGrid.ItemsSource = null; if (tisqry.Count() <= 0) { return; } //StringBuilder sss = new StringBuilder(); foreach (NUT_DATA drow in tisqry) { DataRow d0 = PanRes.NewRow(); float x = (float)drow.Nutr_Val; string rx = string.Format(Helper.StrFormat(decp), x); d0[0] = rx; string des = _selected.Where(f => f.NDB_No == drow.NDB_No).First().Long_Desc; d0[1] = des; PanRes.Rows.Add(d0); //sss.AppendLine(string.Format("NDB = {0} {1} {2} ", drow.NDB_No, rx, des)); } //MessageBox.Show(sss.ToString()); ResGrid.ItemsSource = PanRes.DefaultView; }
private bool SetParam() { if (Group.SelectedItem == null || Nutdef.SelectedItem == null) { MessageBox.Show("The Comboboxes are not set!!!"); return(false); } ndr = Nutdef.SelectedItem as NUTR_DEF; if (ndr == null) { return(false); } return(true); }