I hope this is a quick win for one of you.
I have a datagrid that the user can update. This all works fine with updates updating the db etc.
Can I change the Datagrid so it does not let the user delete rows? As I use a checkbox for any cancelled membership so I can keep the record and report on them so I dont want a user to delete the entire record.
My Code:
Variables:
Load:
Update code:
Many Thanks
I have a datagrid that the user can update. This all works fine with updates updating the db etc.
Can I change the Datagrid so it does not let the user delete rows? As I use a checkbox for any cancelled membership so I can keep the record and report on them so I dont want a user to delete the entire record.
My Code:
Variables:
VB.NET:
[size=2]
[/size][size=2][color=#0000ff]Private[/color][/size][size=2] membuilder [/size][size=2][color=#0000ff]As[/color][/size][size=2] OleDb.OleDbCommandBuilder
[/size][size=2][color=#0000ff]Private[/color][/size][size=2] memedit [/size][size=2][color=#0000ff]As[/color][/size][size=2] [/size][size=2][color=#0000ff]New[/color][/size][size=2] DataTable
[/size]
Load:
VB.NET:
[size=2]
membuilder = [/size][size=2][color=#0000ff]New[/color][/size][size=2] OleDb.OleDbCommandBuilder(OleDbDataAdapter1)
memdata1.Clear()
'studid from global variable
OleDbDataAdapter1.SelectCommand.Parameters("memid").Value = studid
OleDbDataAdapter1.Fill(memdata1)
[/size]
Update code:
VB.NET:
[size=2]
OleDbDataAdapter1.Update(memdata1)
memdata1.AcceptChanges()
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].Close()
[/size]
Many Thanks