Hi Experts
I m using vb .net2008. I want to skip read-only columns, for this I use these codes
But their some error, how is it possible????

Private Sub DataGridView1_CellEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEnter
        Dim y As Integer = DataGridView1.CurrentCellAddress.Y
        Dim x As Integer = DataGridView1.CurrentCellAddress.X
        Dim dg_cr As Integer = DataGridView1.RowCount - 1

        If DataGridView1.CurrentCell.ReadOnly = True Then
            Dim last_s_row As Integer
            last_s_row = DataGridView1.RowCount - 1
            DataGridView1.CurrentCell = DataGridView1.Item(1, last_s_row)
        End If
    End Sub
7 Years
Discussion Span
Last Post by Oxiegen

The error massage is "Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function."


According to this article, the selection of a cell in the DataGridView has turned into an infinite loop, which promply causes the crash.

Probably because you are selecting a new cell from inside one of the cell selection events.

I have no solution for you though.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.