
Disabling Add Rows in a DataGrid in VB.net
I was with the same problem as you and i fixed it setting the propertie
.AllowNew = False on the DataView...
Im not sure if you have a dataview, i hope yes... here is my code anyway.
Dim dt As New DataTable()
dt = rsDC.Tables(0)
dt.TableName = "Notes"
Dim dv As DataView = New DataView(dt)
dv.AllowNew = False
dv.AllowEdit = False
DataGrid1.DataSource = dv
Hope it help...
Quote:
> Hi all,
> I have a form with a datagrid that I'd like the users to be able to
> edit cells of. However, I do not want the user to be able to add to
> the datagrid by typing in the bottom row. The only property I can
> find on the datagrid that deals with this is the Read Only property.
> If I set that to false, it limits the user from adding rows, however
> they obviously can not edit the cells.
> Does anyone have any idea on how to turn off the add row feature on
> the datagrid object?
> Thanks
> -Mike