void ReportDesignPanel_CellStyleChanged(object sender, SheetViewEventArgs e) { for (int i = 0; i < e.RowCount; i++) { for (int j = 0; j < e.ColumnCount; j++) { GridElement Element = ActiveSheet.Cells[i + e.Row, j + e.Column].Value as GridElement; if (Element == null) { Element = new GridElement(); Element.Index = Report.GetElementIndex(i + e.Row, j + e.Column); CellRange Range = getActiveCell(i + e.Row, j + e.Column); Element.Row = Range.Row; Element.Column = Range.Column; Element.RowSpan = Range.RowCount; Element.ColumnSpan = Range.ColumnCount; Element.Report = ActiveSheet; } if (Element.Value == null) { ActiveSheet.Cells[i + e.Row, j + e.Column].CellType = GeneralType; } Report.SetElement(Element); } } }
protected virtual void OnCellStyleChanged(int Row, int Column, int RowCount, int ColumnCount) { SheetViewEventArgs e = new SheetViewEventArgs(Row, Column, RowCount, ColumnCount); EventHandler <SheetViewEventArgs> handler = (EventHandler <SheetViewEventArgs>)Events[CellStyleChangedEvent]; if (handler != null) { handler(ActiveSheet, e); } }
protected virtual void OnRow_ColumnCountChanged(int Row, int Column) { SheetViewEventArgs e = new SheetViewEventArgs(Row, Column); EventHandler <SheetViewEventArgs> handler = (EventHandler <SheetViewEventArgs>)Events[Row_ColumnCountChangedEvent]; if (handler != null) { handler(ActiveSheet, e); } }
private void TableStatistics_Sheet1_CellChanged(object sender, SheetViewEventArgs e) { //if (e.Row % 2 == 0) //{ // switch (e.Column) // { // case 0: // TableStatistics.ActiveSheet.Cells[e.Row + 1, e.Column].Value = TableStatistics.ActiveSheet.Cells[e.Row, e.Column].Value + "(标准值)"; // break; // } //} }
private void fpPayMode_Sheet1_CellChanged(object sender, SheetViewEventArgs e) { string tempString = this.fpPayMode_Sheet1.Cells[e.Row, (int)PayModeCols.PayMode].Text; if (tempString == string.Empty) { for (int i = 0; i < this.fpPayMode_Sheet1.Columns.Count; i++) { this.fpPayMode_Sheet1.Cells[e.Row, i].Text = string.Empty; } } bool isOnlyCash = true; decimal nowCost = 0; for (int i = 0; i < this.fpPayMode_Sheet1.RowCount; i++) { if (this.fpPayMode_Sheet1.Cells[i, (int)PayModeCols.PayMode].Text != string.Empty) { if (this.fpPayMode_Sheet1.Rows[i].Tag != null && this.fpPayMode_Sheet1.Rows[i].Tag.ToString() != "CA" && NConvert.ToDecimal(this.fpPayMode_Sheet1.Cells[i, (int)PayModeCols.Cost].Value) > 0) { isOnlyCash = false; nowCost += NConvert.ToDecimal(this.fpPayMode_Sheet1.Cells[i, (int)PayModeCols.Cost].Value); } } } if (this.realCost == 0) { this.realCost = this.totOwnCost; } if (isOnlyCash) { this.totOwnCost = Neusoft.FrameWork.Public.String.FormatNumber(totOwnCost, 2); this.fpPayMode_Sheet1.Cells[0, (int)PayModeCols.Cost].Text = totOwnCost.ToString(); } else { if (realCost - nowCost < 0) { this.fpPayMode_Sheet1.Cells[e.Row, (int)PayModeCols.Cost].Value = 0; this.fpPayMode_Sheet1.SetActiveCell(e.Row, (int)PayModeCols.Cost, false); nowCost = 0; } this.totOwnCost = Neusoft.FrameWork.Public.String.FormatNumber(realCost, 2); this.fpPayMode_Sheet1.Cells[0, (int)PayModeCols.Cost].Value = realCost - nowCost; } }
void activeSheet_CellChanged(object sender, SheetViewEventArgs e) { if (myCell == null) { return; } CellRange SelectRange = new CellRange(e.Row, e.Column, 1, 1); if (!SelectRange.IsValidRange(myCell.ActiveSheet)) { return; } Boolean Have = false; foreach (List <string> ls in chartInputData.Values) { List <string> x = new List <string>(ls[0].ToLower().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)); List <string> y = new List <string>(ls[1].ToLower().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)); String r = Arabic_Numerals_Convert.Excel_Word_Numerals(e.Column) + (e.Row + 1).ToString(); if (x.Contains(r.ToLower()) || y.Contains(r.ToLower())) { Have = true; break; } } if (!Have) { return; } UpdateChartData(); UpdateChartImage(); }
private void Sheet_RowChanged(object sender, SheetViewEventArgs e) { this.Text = Guid.NewGuid().ToString(); }
private void Sheet_Changed(object sender, SheetViewEventArgs e) { }