By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,534 Members | 865 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,534 IT Pros & Developers. It's quick & easy.

Databound Form - Edit

P: n/a
I want to make all the databound values locked until the user clicks save.
Is there a way doing this, without looping through each control and setting
the ReadOnly = True.

Thanks
Vayse
Nov 21 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Sorry, correct text should be:

I want to make all the databound values locked until the user clicks Edit.
Is there a way of doing this, without looping through each control and
setting the ReadOnly = True.

"Vayse" <Va***@nospam.nospam> wrote in message
news:OZ**************@TK2MSFTNGP11.phx.gbl...
I want to make all the databound values locked until the user clicks save.
Is there a way doing this, without looping through each control and
setting the ReadOnly = True.

Thanks
Vayse

Nov 21 '05 #2

P: n/a
One way...

1) Drag a Panel object onto your form
2) Place all of your data-aware/editable controls onto the Panel
3) Set the Panel's ENABLED property to FALSE
4) Place your Edit button outside of the Panel, and code it to toggle
the ENABLED property of the Panel

Nov 21 '05 #3

P: n/a
Perfect!
Thanks

"Jerry H." <bo*********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
One way...

1) Drag a Panel object onto your form
2) Place all of your data-aware/editable controls onto the Panel
3) Set the Panel's ENABLED property to FALSE
4) Place your Edit button outside of the Panel, and code it to toggle
the ENABLED property of the Panel

Nov 21 '05 #4

P: n/a
Actually, it would be better if the controls were still enabled but read
only.
Theres no read only proprty on the panel.
Any other suggestions?
Thanks
Vayse

"Vayse" <Va***@nospam.nospam> wrote in message
news:eW**************@TK2MSFTNGP09.phx.gbl...
Perfect!
Thanks

"Jerry H." <bo*********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
One way...

1) Drag a Panel object onto your form
2) Place all of your data-aware/editable controls onto the Panel
3) Set the Panel's ENABLED property to FALSE
4) Place your Edit button outside of the Panel, and code it to toggle
the ENABLED property of the Panel


Nov 21 '05 #5

P: n/a
Hi

Based on my knowledge, you need to set the ReadOnly for each control.
Also, windows form has a Controls collection, you may try to loop through
the collection to set for each control.

e.g.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
On Error Resume Next 'In case certain control has no ReadOnly
property
Dim cnt As Object
For Each cnt In Me.Controls
cnt.readOnly = True
Next
End Sub

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #6

P: n/a
I think he wanted to avoid doing that, though I think you are correct,
that is the only way for the time being. It would be nice if the
underlying table (or any datacollection that is bindable to a control)
could be made Readonly to assist in this matter.

Would you know if .NET 2.0 offers a bit more with this sort of
functionality?

Nov 21 '05 #7

P: n/a
Hi

Based on my research, the problem is more concerned with the UI issue. So I
provide the workaround.

BTW for winforms issue, we have special newgroup for that.

microsoft.public.dotnet.framework.windowsforms.dat abinding
microsoft.public.dotnet.framework.windowsforms.con trols
microsoft.public.dotnet.framework.windowsforms

Since VS.NET 2005(Whidbey) has not been released, so far for Whidbey issue,
I think you may try to post in vs2005 forum.
http://lab.msdn.microsoft.com/vs2005/community/

Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #8

P: n/a
Thanks for the heads up, Pete, I went ahead and subscribed to the
databinding group.

My company is eagerly awaiting for the release of SQL 2005 and VS
2005...the new stuff in these two packages are really go to help us an
awful lot.

Nov 21 '05 #9

P: n/a
Hi

Thanks for your quickly reply!
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.