/// <summary> /// 单元格的点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gViewActPara_MouseDown(object sender, MouseEventArgs e) { GridHitInfo hint = DwgdClient.gridView1.CalcHitInfo(e.X, e.Y); //获取单元格的坐标 if (hint.Column.FieldName == "Status") //判断选择的单元格是不是复选框 { int rowHandle = hint.RowHandle; //选择行的索引 string name = this.DwgdClient.gridView1.GetRowCellValue(rowHandle, "Status").ToString(); //获取复选框的值 if (name == "True") //已选中,则设置为不选中 { DwgdClient.gridView1.SetRowCellValue(rowHandle, "Status", false); } else if (name == "False") { DwgdClient.gridView1.SetRowCellValue(rowHandle, "Status", true); } int[] rowID = this.DwgdClient.GridView1.GetSelectedRows(); //选中的行号 if (rowID.Length > 0) //选中的行大于0,则说明有修改 { changeValue = true; //勾选 } } }
时间: 2024-10-06 12:52:02