private void PanelDragDrop(Panel panel, DragEventArgs e, short status) { // The mouse locations are relative to the screen, so they must be // converted to client coordinates. Point clientPoint = panel.PointToClient(new Point(e.X, e.Y)); // If the drag operation was a copy then add the row to the other control. if (e.Effect == DragDropEffects.Copy) { string cellvalue = Convert.ToString(e.Data.GetData(typeof(string))); ZGDataSet.ZGRow zgRow = GetRefByCellValue(cellvalue); zgRow.STATUS = status; /*zgTableAdapter1.Delete( * zgRow.REF, * zgRow.ZG_NR, * zgRow.OPIS, * zgRow.TYP, * zgRow.STATUS, * null, * null, * zgRow.REG_DATE, * null * );*/ UpdateDB(); UpdateControls(); } }
private void DGVCellDoubleClick(DataGridView dgv, DataGridViewCellEventArgs e) { string cellvalue = dgv.Rows[e.RowIndex].Cells[1].Value.ToString(); ZGDataSet.ZGRow zgRow = GetRefByCellValue(cellvalue); zgRow.TYP = (zgRow.TYP < 2) ? zgRow.TYP += 1 : zgRow.TYP = 0; UpdateDB(); UpdateControls(); }
private void DGVDragDrop(DataGridView dgv, DragEventArgs e, short status) { // The mouse locations are relative to the screen, so they must be // converted to client coordinates. Point clientPoint = dgv.PointToClient(new Point(e.X, e.Y)); // If the drag operation was a copy then add the row to the other control. if (e.Effect == DragDropEffects.Copy) { //int cellvalue = Convert.ToInt32(e.Data.GetData(typeof(int))); string cellvalue = Convert.ToString(e.Data.GetData(typeof(string))); ZGDataSet.ZGRow zgRow = GetRefByCellValue(cellvalue); zgRow.STATUS = status; UpdateDB(); UpdateControls(); } }