日期:2014-05-18 浏览次数:20994 次
DataGridViewCheckBoxCell cell = new DataGridViewCheckBoxCell(); public test() { InitializeComponent(); cell.FalseValue = 0; cell.TrueValue = 1; } private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { int rowindex = e.RowIndex; int columnindex = e.ColumnIndex; if (columnindex == 0) { cell = (DataGridViewCheckBoxCell)this.dataGridView1.Rows[rowindex].Cells[0]; object a = cell.Value; a = cell.FormattedValue; a = cell.Tag; DataGridViewElementStates state =this.dataGridView1.Rows[rowindex].Cells[0].State; } }
------解决方案--------------------
应该让微软提供CellValueChanged事件处理。