internal static void SwapRow(MyGrid grid, Xceed.Grid.CellRow row1, Xceed.Grid.CellRow row2) { foreach (Xceed.Grid.Column c in grid.Columns) { object t = row1.Cells[c.Index].Value; row1.Cells[c.Index].Value = row2.Cells[c.Index].Value; row2.Cells[c.Index].Value = t; } }
public static void SetCellButton(IBoundGrid grid, string columnName, System.Windows.Forms.Button btn) { Xceed.Grid.CellRow row = null; foreach (Xceed.Grid.Row i in grid.FixedFooterRows) { row = i as Xceed.Grid.CellRow; if (row != null && row.Cells[columnName] != null) { break; } } if (row != null) { btn.Parent.Controls.Remove(btn); btn.Visible = true; grid.DisplayManager.SearchManager.DataLoaded += new EventHandler <DataLoadedEventArgs>((sender, e) => { Xceed.Grid.CellRow row2 = null; foreach (Xceed.Grid.Row i in grid.FixedFooterRows) { row2 = i as Xceed.Grid.CellRow; if (row2 != null && row2.Cells[columnName] != null) { break; } } if (row2 != null) { row2.Cells[columnName].CellViewerManager = new Xceed.Grid.Viewers.CellViewerManager(btn, string.Empty); row2.Cells[columnName].CellEditorManager = new Xceed.Grid.Editors.CellEditorManager(btn, string.Empty, true, true); } }); row.Cells[columnName].CellViewerManager = new Xceed.Grid.Viewers.CellViewerManager(btn, string.Empty); row.Cells[columnName].CellEditorManager = new Xceed.Grid.Editors.CellEditorManager(btn, string.Empty, true, true); } }
private bool 专家任务下达Validation(Xceed.Grid.CellRow row) { if (row.Cells["区域名称"].Value == null) { MessageForm.ShowWarning("请填写“区域名称”。"); return(false); } //if (row.Cells["时间要求始"].Value == null) //{ // MessageForm.ShowWarning("请填写“时间要求始”。"); // return false; //} //else if (row.Cells["时间要求止"].Value == null) //{ // MessageForm.ShowWarning("请填写“时间要求止”。"); // return false; //} //else if ((DateTime)row.Cells["时间要求始"].Value >= (DateTime)row.Cells["时间要求止"].Value) //{ // MessageForm.ShowWarning("时间要求始必须小于时间要求止!"); // return false; //} return(true); }