changing DataGridView cell border style on DragOver

Unanswered changing DataGridView cell border style on DragOver

  • Friday, May 26, 2006 1:24 AM
     
     
    I'm trying to change the top cell border of a DataGridView cell when I drag something over the cell. What I have compiles, but it's not effecting the cell.

    private void dataGridView1_DragOver(object sender, DragEventArgs e)
    {
        Point p = dataGridView1.PointToClient(new Point(e.X, e.Y));
        DataGridView.HitTestInfo hit = dataGridView1.HitTest(p.X, p.Y);

        if (hit.ColumnIndex == 0 && hit.Type == DataGridViewHitTestType.Cell)
        {
            e.Effect = DragDropEffects.Move;

            DataGridViewAdvancedBorderStyle styleInput = new DataGridViewAdvancedBorderStyle();
            DataGridViewAdvancedBorderStyle styleTemp = new DataGridViewAdvancedBorderStyle();

            styleInput.Top = DataGridViewAdvancedCellBorderStyle.OutsetDouble;

            dataGridView1[hit.ColumnIndex, hit.RowIndex].AdjustCellBorderStyle(
                styleInput, styleTemp, true, true, true, false);
        }
        else
        {
            e.Effect = DragDropEffects.None;
        }
    }