日期:2014-05-17 浏览次数:21061 次
?
dataGridView1.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
?
dataGridView1.Columns[0].Frozen = true;
?
?
OracleClass.Open(); OracleDataReader dtr = OracleClass.QueryForReader(sql_select); if (dtr != null) { while (dtr.Read()) { int CA_ID = int.Parse(dtr.GetOracleNumber(0).ToString()); int BASEID = int.Parse(dtr.GetOracleNumber(1).ToString()); String BASENAME = dtr.GetOracleString(2).ToString().Substring(0, dtr.GetOracleString(2).ToString().Length - 1); String CA_NAME = dtr.GetOracleString(3).ToString(); String CA_RULETYPE = dtr.GetOracleNumber(4).ToString(); if (CA_RULETYPE.Equals("1")) { CA_RULETYPE = "范围匹配类型"; } else if (CA_RULETYPE.Equals("2")) { CA_RULETYPE = "标准格式类型"; } else if (CA_RULETYPE.Equals("3")) { CA_RULETYPE = "固定格式类型"; } else if (CA_RULETYPE.Equals("4")) { CA_RULETYPE = "逻辑关联类型"; } else { CA_RULETYPE = "无"; } String CA_RULETEXT = dtr.GetOracleString(5).ToString(); if (CA_RULETEXT.Equals("Null") || (CA_RULETEXT.Equals("NULL"))) { CA_RULETEXT = ""; } String CA_RULETEXT2 = dtr.GetOracleString(6).ToString(); if (CA_RULETEXT2.Equals("Null") || (CA_RULETEXT2.Equals("NULL"))) { CA_RULETEXT2 = ""; } String CONTENT = dtr.GetOracleString(7).ToString(); if (CONTENT.Equals("Null") || CONTENT.Equals("NULL")) { CONTENT = ""; } object[] data = new object[] { CA_ID, BASEID, BASENAME, CA_NAME, CA_RULETYPE, CA_RULETEXT, CA_RULETEXT2, CONTENT }; this.dataGridView1.Rows.Add(false, CA_ID, BASEID, BASENAME, CA_NAME, CA_RULETYPE, CA_RULETEXT, CA_RULETEXT2, CONTENT); } OracleClass.Close();
?
private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (checkBox1.Checked) { for (int i = 0; i < dataGridView1.Rows.Count; i++) { this.dataGridView1.Rows[i].Cells[0].Value = true; } } else { for (int i = 0; i<dataGridView1.Rows.Count;i++ ) { this.dataGridView1.Rows[i].Cells[0].Value = false; } } }
?
dataGridView1.Rows.Clear();
?
//树节点点击事件 private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node.Text == "应用规则类型" || e.Node.Text == "设备类型名称") { dataGridView1.Rows.Clear(); Load2(); } else { //点击类型节点 if (e.Node.Text == "范围匹配类型" || e.Node.Text == "标准格式类型" || e.Node.Text == "固定格式类型" || e.Node.Text == "逻辑关联类型") { dataGridView1.Rows.Clear(); OracleClass.Open(); int type = 0; if (e.Node.Text == "范围匹配类型") { type = 1; } else if (e.Node.Text == "标准格式类型") { type = 2; } else if (e.Node.Text == "固定格式类型") { type = 3; } else if (e.Node.Text == "逻辑关联类型"