void btn_MoveLast_Click(object sender, EventArgs e) { HandCallInit(Customer_BeforeMoveLast, Customer_AfterMoveLast, new EventHandler(delegate { DataTableMoveTools.DataRowMoveLast(View.GetFocusedDataRow()); View.MoveLast(); })); }
private void gc_DataDetail_EmbeddedNavigator_ButtonClick(object sender, DevExpress.XtraEditors.NavigatorButtonClickEventArgs e) { int handle = gv_DataDetail.FocusedRowHandle; if (e.Button.ButtonType == NavigatorButtonType.First) { DataTableMoveTools.DataRowMoveFirst(gv_DataDetail.GetFocusedDataRow()); gv_DataDetail.MoveFirst(); UpdateIndex(); e.Handled = true; } else if (e.Button.ButtonType == NavigatorButtonType.Last) { DataTableMoveTools.DataRowMoveLast(gv_DataDetail.GetFocusedDataRow()); gv_DataDetail.MoveLast(); UpdateIndex(); e.Handled = true; } else if (e.Button.ButtonType == NavigatorButtonType.Prev) { DataTableMoveTools.DataRowMovePrev(gv_DataDetail.GetFocusedDataRow()); gv_DataDetail.FocusedRowHandle = handle - 1; UpdateIndex(); e.Handled = true; } else if (e.Button.ButtonType == NavigatorButtonType.Next) { DataTableMoveTools.DataRowMoveNext(gv_DataDetail.GetFocusedDataRow()); gv_DataDetail.FocusedRowHandle = handle + 1; UpdateIndex(); e.Handled = true; } else if (e.Button.ButtonType == NavigatorButtonType.Append) { DataTable dt = gc_DataDetail.DataSource as DataTable; DataRow dr = dt.Rows.Add(); dr[dt_CommonDicData.DataType] = gv_DataType.GetFocusedRowCellValue("Name"); UpdateIndex(); e.Handled = true; } else if (e.Button.ButtonType == NavigatorButtonType.Remove) { if (Msg.AskQuestion("确定要删除选中的记录吗?") == false) { e.Handled = true; } } }