Found a solution at
http://www.dotnet247.com/247referenc.../15/77606.aspx
I think if you will declare an integer and count the rows and substitute
your intger variable where "10" is located.
There is 10 rows in my Data Grid.
When user tries to go to new row (the asterisk row), 11th row, re-position
the cell to the last row (10th row).
Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles DataGrid1.CurrentCellChanged
If (DataGrid1.CurrentCell.RowNumber > 10) Then
DataGrid1.CurrentCell = New DataGridCell(10,
DataGrid1.CurrentCell.ColumnNumber) ' Re-position back to 10th row
End If
End Sub
"Allan Wong" <bu***@singnet.com.sg> wrote in message
news:ODKQ3QG3BHA.1940@tkmsftngp05...
[Original message clipped]
"Mark" <ma***@dynatechsolutions.com> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
Hi,
I am using a datagrid on windows form. What I want is that it should allow
editing of certain columns but should not allow adding new rows. I have
added a table style and the columns to the table style collection but I
still get a last row with * allowing the users to add new record.
If I turn the grid into readonly then the user cant modify the columns. Is
there any way to block adding new rows or to get rid of the last row with *?
Mark