private void ContextMenu_void(object sender, System.EventArgs e) { FarPoint.Win.Spread.Row row = grdView.ActiveSheet.ActiveRow; FarPoint.Win.Spread.Column c; c = grdView.ActiveSheet.ActiveColumn; String aa = grdView.Sheets[0].Cells[grdView.ActiveSheet.ActiveRow.Index, colCode].Value == null ? "" : grdView.Sheets[0].Cells[grdView.ActiveSheet.ActiveRow.Index, colCode].Value.ToString(); if (MessageBox.Show("ต้องการ ยกเลิก \nรายการ" + aa, "", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.OK) { String re = xC.xtDB.banDB.voidBank(grdView.Sheets[0].Cells[grdView.ActiveSheet.ActiveRow.Index, colID].Value == null ? "" : grdView.Sheets[0].Cells[grdView.ActiveSheet.ActiveRow.Index, colID].Value.ToString()); if (re.Equals("1")) { grdView.Sheets[grdView.ActiveSheet.SheetName].Cells[grdView.ActiveSheet.ActiveRow.Index, 0, grdView.ActiveSheet.ActiveRow.Index, colCnt - 1].BackColor = Color.Gray; } } }
/// <summary> /// 删除按钮单击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void neuButtonDelete_Click(object sender, EventArgs e) { int selectRow = this.neuSpread1_Sheet1.SelectionCount; if (selectRow > 0) { if (DialogResult.Yes != MessageBox.Show("是否操作?", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)) { return; } foreach (FarPoint.Win.Spread.Model.CellRange selectRange in this.neuSpread1_Sheet1.GetSelections()) { try { FarPoint.Win.Spread.Row row = this.neuSpread1_Sheet1.Rows [selectRange.Row]; Neusoft.HISFC.Models.HealthRecord.Case.CaseBill caseBill = row.Tag as Neusoft.HISFC.Models.HealthRecord.Case.CaseBill; if (caseBill.Memo == "New") { this.neuSpread1_Sheet1.Rows.Remove(selectRange.Row, 1); } else { if (caseBill.CaseInfo.Memo == "Delete") { caseBill.CaseInfo.Memo = ""; this.neuSpread1_Sheet1.RowHeader.Rows [selectRange.Row].Label = ""; this.neuButtonDelete.Text = "删除"; } else { caseBill.CaseInfo.Memo = "Delete"; this.neuSpread1_Sheet1.RowHeader.Rows [selectRange.Row].Label = "Del"; this.neuButtonDelete.Text = "取消删除"; } this.neuSpread1_Sheet1.Rows [selectRange.Row].Tag = caseBill; } } catch (Exception exception) { MessageBox.Show(exception.Message); } } } }
public CompareableRow(object objectToCompare, FarPoint.Win.Spread.Row r) { comparer = objectToCompare; row = r; }