using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using CoreFS.CA06; using System.Collections; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; namespace Core.LZMes.Client.QCM { public partial class QCM030803 : FrmBase { public QCM030803() { InitializeComponent(); } public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case"Query": this.DoQuery(); break; case "Judge": this.Judge(); break; case "Cancel": this.Cancel(); break; case "Export": this.DoExport(); break; } } private void Judge() { try { int count = 0; foreach (UltraGridRow ugr in this.ultraGrid1.Rows) { if (ugr.Cells["CHECK"].Text.ToString() == "True") { string heat_no = ugr.Cells["HEAT_NO"].Value.ToString(); string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString(); string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString(); if (design_key.Equals("")) { if (MessageBox.Show(this, "此板坯无订单号,采用炼钢牌号判定,是否继续操作?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } } string grade_name = ugr.Cells["GRADE_NAME"].Value.ToString(); string prod_name = ugr.Cells["PROD_NAME"].Text.ToString(); string username = this.UserInfo.GetUserName(); string assay_no = ""; UltraGridRow ugrs = this.ultraGrid1.ActiveRow; if (heat_no.Equals(ugrs.Cells["HEAT_NO"].Value.ToString())) { List list1 = new List(); foreach (UltraGridRow ugrt in this.ultraGrid2.Rows) { if (ugrt.Cells["CHECKBOX"].Text.ToString() == "True") { assay_no = ugrt.Cells["STD_TYPE"].Value.ToString(); list1.Add(assay_no); } } if (list1.Count == 0) { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "LGRlChemJudgeBySystem"; ccp.ServerParams = new object[] { heat_no, material_no, design_key, username, grade_name, prod_name, "4001LG0" }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == 2 && count == 0) { MessageBox.Show(ccp.ReturnInfo); count++; } } else { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "LGRlChemJudgeByHuman"; ccp.ServerParams = new object[] { heat_no, material_no, design_key, username, grade_name, list1, prod_name, "4001LG0" }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == 2 && count == 0) { MessageBox.Show(ccp.ReturnInfo); count++; } } } else { CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "LGRlChemJudgeBySystem"; ccp.ServerParams = new object[] { heat_no, material_no, design_key, username, grade_name, prod_name, "4001LG0" }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode == 2 && count == 0) { MessageBox.Show(ccp.ReturnInfo); count++; } } } } if (count == 0) { MessageBox.Show("判定成功!"); } //UltraGridRow ugr = this.ultraGrid1.ActiveRow; //List list1 = new List(); //if (ugr == null) // return; //string heat_no = ugr.Cells["HEAT_NO"].Value.ToString(); //string material_no = ugr.Cells["MATERIAL_NO"].Value.ToString(); //string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString(); //string grade_name = ugr.Cells["GRADE_NAME"].Value.ToString(); //string prod_name = ugr.Cells["PROD_NAME"].Text.ToString(); //string username = this.UserInfo.GetUserName(); //string assay_no = ""; //foreach (UltraGridRow ugrs in this.ultraGrid2.Rows) //{ // if (ugrs.Cells["CHECKBOX"].Text.ToString() == "True") // { // assay_no = ugrs.Cells["STD_TYPE"].Value.ToString(); // list1.Add(assay_no); // } //} //if (list1.Count == 0) //{ // MessageBox.Show("请选择检验实绩!"); // return; //} //CoreClientParam ccp = new CoreClientParam(); //ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; //ccp.MethodName = "LGRlChemJudgeByHuman"; //ccp.ServerParams = new object[] { heat_no, material_no, design_key, username, grade_name, list1, prod_name, "4001LG0" }; //ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); //if (ccp.ReturnCode == -1) //{ // return; //} //ugr.Delete(false); //MessageBox.Show("判定成功!"); } catch(Exception EX) { MessageBox.Show(EX.ToString()); } DoQuery(); } private void Cancel() { try { UltraGridRow ugr = this.ultraGrid4.ActiveRow; if (ugr == null) return; string MATERIAL_NO = ugr.Cells["MATERIAL_NO"].Value.ToString(); string username = this.UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJudgeChemicalServiceImpl"; ccp.MethodName = "CancelLgRJudge"; ccp.ServerParams = new object[] { MATERIAL_NO, username }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp.ReturnCode != -1) { MessageBox.Show("取消判定成功!"); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void DoQuery() { if (this.ultraTabControl1.Tabs[0].Selected) //待判信息 { DoQueryMe(); } if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { DoQueryRe(); } } //查询待判信息 private void DoQueryMe() { try { this.dataSet5.Clear(); string heatno = this.textBox1.Text.Trim(); string prod_type = this.comboBox2.Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "getLgRejudgeInfo"; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), heatno,"4001LG0",prod_type,"C"}; ccp.SourceDataTable = this.dataSet5.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } //查询判定记录 private void DoQueryRe() { try { this.dataSet1.Clear(); string heatno = textBox1.Text.Trim(); string isvalid = "0"; if (checkBox2.Checked) { isvalid = "1"; } CoreClientParam ccp = new CoreClientParam(); string prod_type = this.comboBox2.Text.ToString(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "getLgjudgeInfo"; ccp.ServerParams = new object[] { this.dateTimePicker1.Value.ToString("yyyy-MM-dd"), this.dateTimePicker2.Value.ToString("yyyy-MM-dd"), heatno, "4001LG0", prod_type, "C" ,isvalid}; ccp.SourceDataTable = this.dataSet1.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void ultraGrid4_AfterRowActivate(object sender, EventArgs e) { try { UltraGridRow ugr = this.ultraGrid4.ActiveRow; if (ugr == null) return; this.dataSet4.Clear(); string cic_id = ugr.Cells["CIC_ID"].Value.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetLgRChemeResult"; ccp.ServerParams = new object[] { cic_id }; ccp.SourceDataTable = this.dataSet4.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); //ccp = new CoreClientParam(); //ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; //ccp.MethodName = "GetCheme"; //ccp.ServerParams = new object[] { cic_id }; //this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); //for (int i = 0; i < ccp.SourceDataTable.Rows.Count; i++) //{ // foreach (UltraGridRow ugr5 in this.ultraGrid5.Rows) // { // if (ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Value.ToString().Contains(ccp.SourceDataTable.Rows[i]["stdmin"].ToString()) && ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Value.ToString().Contains(ccp.SourceDataTable.Rows[i]["stdmax"].ToString())) // { // ugr5.Cells[ccp.SourceDataTable.Rows[i]["phy_code_s"].ToString()].Appearance.BackColor = Color.Red; // } // } //} UltraGridRow judge_row = null; foreach (UltraGridRow ugst in this.ultraGrid5.Rows) { if(ccp.ReturnInfo.Contains (ugst.Cells["STD_TYPE"].Text.ToString())) { ugst.Appearance.BackColor = Color.Green; } if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求")) { judge_row = ugst; } if (judge_row != null) { foreach (UltraGridRow ugs in this.ultraGrid5.Rows) { if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && (ugs.Cells["STD_TYPE"].Text.ToString() == "放行标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "交付标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")) { for (int i = 0; i < ugs.Cells.Count; i++) { if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" ")) { string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#'); if (str_arr.Length == 1) { if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (string.IsNullOrEmpty(judge_row.Cells[i].Text)) { judge_row.Cells[i].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (str_arr.Length == 2) { if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (string.IsNullOrEmpty(judge_row.Cells[i].Text)) { judge_row.Cells[i].Appearance.BackColor = Color.Red; if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } } } } } } } } catch (Exception ex) { //System.Diagnostics.Debug.WriteLine(ex.ToString()); //MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { try { UltraGridRow ugr = this.ultraGrid1.ActiveRow; if (ugr == null) return; this.dataSet3.Clear(); string design_key = ugr.Cells["DESIGN_KEY"].Value.ToString(); if (design_key.Equals("")) { design_key = ugr.Cells["OLD_DESIGN_KEY"].Value.ToString(); } string smp_no = ugr.Cells["HEAT_NO"].Value.ToString(); string grade_name = ugr.Cells["GRADE_NAME"].Text.ToString(); CoreClientParam ccp = new CoreClientParam(); ccp.ServerName = "QCM.QCM03.QCM0301.QcmJhyElementsServiceImpl"; ccp.MethodName = "GetLgRChemeInfo"; ccp.ServerParams = new object[] { design_key, smp_no,grade_name }; ccp.SourceDataTable = this.dataSet3.Tables[0]; this.ExecuteQueryToDataTable(ccp, CoreInvokeType.Internal); UltraGridRow judge_row = null; int count1 = 0; List s = new List(); foreach (UltraGridRow ugst in this.ultraGrid2.Rows) { if (!ugst.Cells["STD_TYPE"].Text.ToString().Contains("标准") && !ugst.Cells["STD_TYPE"].Text.ToString().Contains("要求")) { judge_row = ugst; } if (judge_row != null) { foreach (UltraGridRow ugs in this.ultraGrid2.Rows) { if (!string.IsNullOrEmpty(ugs.Cells["STD_TYPE"].Text) && (ugs.Cells["STD_TYPE"].Text.ToString() == "放行标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "交付标准(熔炼)" || ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)")) { for (int i = 0; i < ugs.Cells.Count; i++) { if (!string.IsNullOrEmpty(ugs.Cells[i].Text) && ugs.Cells[i].Text.ToString().Contains(" ")) { string[] str_arr = ugs.Cells[i].Text.ToString().Replace(" ", "#").Split('#'); if (str_arr.Length == 1) { if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; if(!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; if (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (string.IsNullOrEmpty(judge_row.Cells[i].Text)) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; if (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (str_arr.Length == 2) { if (str_arr[0].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; if (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (str_arr[0].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[0].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; if (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } if (str_arr[1].Contains("<=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[1].Replace("<=", "")) < double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; if (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (str_arr[1].Contains(">=") && !string.IsNullOrEmpty(judge_row.Cells[i].Text)) { if (double.Parse(str_arr[1].Replace(">=", "")) > double.Parse(judge_row.Cells[i].Text.ToString())) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; if (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } else if (string.IsNullOrEmpty(judge_row.Cells[i].Text)) { judge_row.Cells[i].Appearance.BackColor = Color.Red; judge_row.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; if (!s.Contains(judge_row.Cells[i].ToString())) { s.Add(judge_row.Cells[i].ToString()); count1++; } if (ugs.Cells["STD_TYPE"].Text.ToString() == "特殊要求(熔炼)") { ugs.Cells["STD_TYPE"].Appearance.BackColor = Color.Red; } } } } } } } } } if (count1 > 0) { this.label2.BackColor = Color.Red; this.label2.Text = "" + smp_no + "有" + count1 + "条元素成分不合格!"; //MessageBox.Show("" + smp_no + "有" + count1 + "条元素成分不合格!"); } else { this.label2.Text = ""; } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); MessageBox.Show("系统出错,请联系管理人员", "警告"); } } private void QCM030803_Load(object sender, EventArgs e) { this.comboBox2.SelectedIndex = 0; this.checkBox2.Visible = false; this.ultraGrid4.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.ultraGrid1.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons; this.dateTimePicker1.Value = System.DateTime.Now.AddDays(-3); this.DoQuery(); } private void ultraTabControl1_Click(object sender, EventArgs e) { if (this.ultraTabControl1.Tabs[1].Selected) //判定记录 { this.checkBox2.Visible = true; this.label6.Text = "判定时间"; } if (this.ultraTabControl1.Tabs[0].Selected) //判定记录 { this.checkBox2.Visible = false; this.label6.Text = "生产时间"; } } private void DoExport() { try { if (this.ultraGrid4.Rows.Count == 0) { MessageBox.Show("没有可以导出的数据", "提示"); return; } if (this.saveFileDialog1.ShowDialog(this) == DialogResult.OK) { string fName = this.saveFileDialog1.FileName; this.ultraGridExcelExporter1.Export(this.ultraGrid4, fName); Process.Start(fName); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } } private void checkBox1_CheckedChanged(object sender, EventArgs e) { foreach (UltraGridRow ugr in this.ultraGrid1.Rows.Where(p => p.IsFilteredOut == false).ToList()) { if (checkBox1.Checked) { ugr.Cells["CHECK"].Value = "True"; } else { ugr.Cells["CHECK"].Value = "False"; } } } private void ultraGrid2_ClickCell(object sender, ClickCellEventArgs e) { if (e.Cell.Column.Key.ToString() == "CHECKBOX") { foreach (UltraGridRow ugr in this.ultraGrid2.Rows.Where(p => p.IsFilteredOut == false).ToList()) { ugr.Cells["CHECKBOX"].Value = "False"; } } } } }