if (e.KeyChar == 118 || e.KeyChar == 86)// v,V to paste { String Msg = ""; if (CopyString != "" && CopyString != null) { int irow = Convert.ToInt16(datagridView.CurrentCellAddress.Y.ToString()); for (int i = 2; i < datagridView.Columns.Count; i++) { if (datagridView[i, irow].Value != "" && datagridView[i, irow].Value != null) { if (datagridView[i, irow].Value.ToString().Trim() == CopyString.ToString().Trim()) { Msg = "Course is already entered in " + datagridView.Columns[i].HeaderText; } } } //if (Msg.ToString() != null) //{ // MessageBox.Show(Msg.ToString()); //} //else { datagridView.CurrentCell.Value = CopyString.ToString(); } } e.Handled = true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)