Prevent change or edit data using bindingsource

S

sennopati

Hello there...
I generate text box by dragging datasources definition into my form.
Till now i don't have idea how to protect user editing data after call
Fill function to fill dataset object??

Here are the statement:

Dim iRow As Integer
iRow = DaEntity.Fill(DsEntity1)
If iRow = 0 Then
Mst_entityBindingSource.AddNew()
Else
'----> i want to add statement that user cannot modified data
after fill dataset
'
SomeTextBox.Focus()
End If


Note : User can edit data after click Edit button or Menu

thx..
 
R

RobinS

myBindingSource.AllowEdit = False
myBindingSource.AllowNew = False
myBindingSource.AllowRemove = False


RobinS.
GoldMail, Inc.
 
S

sennopati

1. thecontrol.enabled = false --> what this mean??

2. myBindingSource.AllowEdit = False ===> Cannot assign value into
allowedit, because this is a Readonly Property.

does anyone can answer my question?
 
E

ersatz53

1. thecontrol.enabled = false --> what this mean??

2. myBindingSource.AllowEdit = False  ===> Cannot assign value into
allowedit, because this is a Readonly Property.

does anyone can answer my question?

Set the ReadOnly Property of your text box to True.

This will stop any edits from being made to the data.

/tr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top