hirenpatel53 -1 Posting Whiz in Training

hello all

i created windows application in C# into it i i want to drag one Item Code from grid1 to grid2 but before droping Itemcode into grid2 iam checking that itemcode is available in grid3 or not for that i pick the ItemCode of dragrow and via two for loop iam chikcing it with grid3 if it is Present in grid3 then i am showing message and returning the application

Problem is when message comes the mouse cursor remain Busy it does not get change to default even if i use Cursors.Default


go throu the cone try to help me

private void Results_DragEnter(object sender, DragEventArgs e)
        {
            try
            {

                DataTable dt = SupraClasses.SupraDatabase.Database.GetDataTable("select dx1,dx2,dx3,dx4 from appointmentproceduremap where AppointmentID= " + _AppointmentID + ";");
                dg1.DataSource = dt;


                foreach (DataGridViewRow _row in dg1.Rows)
                {
                    foreach (DataGridViewCell _cell in _row.Cells)
                    {
                        if (Convert.ToInt32(cdraggedID) == Convert.ToInt32(_cell.Value))
                        {
                            Cursor.Current = Cursors.UpArrow;
                            MessageBox.Show("Diagnosis is allready in use \n You can not remove it now", "Supra EMR", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            return;
                        }
                    }

                }

                DataGridViewRow row = (DataGridViewRow)Convert.ChangeType(cdragged.Item, typeof(DataGridViewRow));
                if (cdropped == DragDropEffects.None)
                {
                    SelectedList.Rows.Remove(row);
                    DataTable table = (DataTable)Convert.ChangeType(SelectedList.DataSource, typeof(DataTable));
                    table.AcceptChanges();
                    UpdateRowSequence(table);
                }
            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.Message.ToString());
            }
    }

Thank's in advance