public void SetColumnFromSelector(int row, int sheetColumn, int cellColumn) { if (DocumentCache == null) { DocumentCache = ModuleHelperClient.GetDefaultDocument(SelectionModuleID); if (SheetsCache == null && DocumentCache != null) { SheetsCache = new SheetView[DocumentCache.Sheets.Count]; for (var i = 0; i < SheetsCache.Length; i++) { var xml = ModuleHelperClient.GetSheetXMLByID(DocumentCache.Sheets[i].ID); var sheet = Serializer.LoadObjectXml(typeof(SheetView), xml, "SheetView") as SheetView; sheet.SheetName = DocumentCache.Sheets[i].Name; SheetsCache[i] = sheet; } } } var selector = new CellSelector(CurrentModule.ID, "", Guid.Empty); selector.Preloading(SheetsCache, DocumentCache); if (DialogResult.OK == selector.ShowDialog()) { TableStatistics.ActiveSheet.Cells[row, sheetColumn].Value = selector.SheetName; TableStatistics.ActiveSheet.Cells[row, sheetColumn].Tag = selector.SheetID; TableStatistics.ActiveSheet.Cells[row, cellColumn].Value = selector.CellName; TableStatistics.ActiveSheet.Cells[row, cellColumn].Tag = selector.CellName; } }
private void fpSpread1_CellDoubleClick(object sender, CellClickEventArgs e) { QualifySetting item = null; if (module != null) { if (module.QualifySettings != null) { foreach (QualifySetting ms in module.QualifySettings) { if (ms.CellName == this.fpSpread1.ActiveSheet.Cells[e.Row, 0].Value.ToString()) { item = ms; } } } } CellSelector cs = new CellSelector(moduleID, "", Guid.Empty); if (cs.ShowDialog() == DialogResult.OK) { item.CellName = cs.CellName; item.SheetID = cs.SheetID; BindQualifySetting(); } }
private void Button_Cell_Click(object sender, EventArgs e) { CellSelector cs = new CellSelector(moduleID, "", sheetID); if (cs.ShowDialog() == DialogResult.OK) { sheetID = cs.SheetID; label_DataItemInfo.Text = cs.CellName; } }
private void bt_cellSelect_Click(object sender, EventArgs e) { String cellName = Item == null ? "" : Item.CellName; CellSelector cs = new CellSelector(moduleID, cellName, sheetID); if (cs.ShowDialog() == DialogResult.OK) { sheetID = cs.SheetID; tb_cell.Text = cs.CellName; } }
private void fpSpread2_ButtonClicked(object sender, EditorNotifyEventArgs e) { if (e.Column == 2 && Convert.ToBoolean(SheetView2.Rows[e.Row].Tag)) { CellSelector cellSelector = new CellSelector(moduleID, "", Guid.Empty); if (DialogResult.OK == cellSelector.ShowDialog()) { SheetView2.Cells[e.Row, 1].Value = cellSelector.CellName; SheetView2.Cells[e.Row, 1].Tag = cellSelector.SheetID; } } }
private void fpSpread2_ButtonClicked(object sender, EditorNotifyEventArgs e) { if (rb_ylj.Checked) { if (e.Column == 3) { CellSelector cellSelector = new CellSelector(moduleID, "", Guid.Empty); if (DialogResult.OK == cellSelector.ShowDialog()) { sheetView1.Cells[e.Row, 2].Value = cellSelector.CellName; sheetView1.Cells[e.Row, 2].Tag = cellSelector.SheetID; } } else if (e.Column == 0) { sheetView1.Rows.Remove(e.Row, 1); } } else if (rb_wnj.Checked) { if (e.Column == 0) { SheetView2.Rows.Remove(e.Row, 1); } else if (e.Column == 3) { CellSelector cellSelector = new CellSelector(moduleID, "", Guid.Empty); if (DialogResult.OK == cellSelector.ShowDialog()) { SheetView2.Cells[e.Row, 2].Value = cellSelector.CellName; SheetView2.Cells[e.Row, 2].Tag = cellSelector.SheetID; } } else if (e.Column == 5) { CellSelector cellSelector = new CellSelector(moduleID, "", Guid.Empty); if (DialogResult.OK == cellSelector.ShowDialog()) { SheetView2.Cells[e.Row, 4].Value = cellSelector.CellName; SheetView2.Cells[e.Row, 4].Tag = cellSelector.SheetID; } } else if (e.Column == 7) { CellSelector cellSelector = new CellSelector(moduleID, "", Guid.Empty); if (DialogResult.OK == cellSelector.ShowDialog()) { SheetView2.Cells[e.Row, 6].Value = cellSelector.CellName; SheetView2.Cells[e.Row, 6].Tag = cellSelector.SheetID; } } } }
/// <summary> /// 添加显示项 /// </summary> private void AppendItem() { CellSelector cs = new CellSelector(moduleID, "", Guid.Empty); if (cs.ShowDialog() == DialogResult.OK) { QualifySetting qs = new QualifySetting(); qs.CellName = cs.CellName; qs.SheetID = cs.SheetID; if (module.QualifySettings == null) { module.QualifySettings = new List <QualifySetting>(); } module.QualifySettings.Add(qs); BindQualifySetting(); } }
private void fpSpread1_ButtonClicked(object sender, EditorNotifyEventArgs e) { if (e.Column == 2)//试验项目 { TestProjectDialog Dialog = new TestProjectDialog(); if (DialogResult.OK == Dialog.ShowDialog()) { if (Dialog.SelectedItem != null) { sheetView1.Cells[e.Row, 1].Value = Dialog.SelectedItem.Description.Trim(); sheetView1.Cells[e.Row, 1].Tag = Dialog.SelectedItem.Index; } } } if (e.Column == 5)//龄期变量 { CellSelector cellSelector = new CellSelector(moduleID, "", Guid.Empty); if (DialogResult.OK == cellSelector.ShowDialog()) { sheetView1.Cells[e.Row, 4].Value = cellSelector.CellName; sheetView1.Cells[e.Row, 4].Tag = cellSelector.SheetID; } } if (e.Column == 7)//验证数据来源 { CellSelector cellSelector = new CellSelector(moduleID, "", Guid.Empty); if (DialogResult.OK == cellSelector.ShowDialog()) { sheetView1.Cells[e.Row, 6].Value = cellSelector.CellName; sheetView1.Cells[e.Row, 6].Tag = cellSelector.SheetID; } } if (e.Column == 8)//删除 { sheetView1.Rows.Remove(e.Row, 1); } }