473,320 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Databound Form - Edit

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
9 1189
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Patrick Demets | last post by:
I have a fairly simple form with databound text boxes, but changes (or new records) are not recognized. The text boxes are successfully populated with data (from the database) and I can cycle...
0
by: John Smith | last post by:
Hello all: Another day another problem :). How do you synch a databound combobox with the rest of the controls that are on a form. I have a combobox that lists a bunch of names and upon...
2
by: BobRoyAce | last post by:
I am brand new to ASP.NET and am now required to take over maintenance of a ..NET/C# web application. On one of the pages I'm working on there is a DataGrid which has multiple columns. One of the...
1
by: Matt | last post by:
I recently came across what I believe to be a peculiar bug with Mdi Children, and wanted to see if anyone else had experienced this before sending it in. The issue is as follows: I have a number...
9
by: Jakob Lithner | last post by:
1) I have a DataGridView with edit capability. But in some columns I want to limit the input with a DropDownList. There is no inbuilt column for DropDownLists so I intended to add one myself. I...
5
by: maurban | last post by:
Hi there experts, I have a gridview with a couple textboxes and a dropdownlist. I'm trying to insert a default value into my database driven dropdownlist. I'm doing this in the rowdatabound...
0
by: Beni.Huber | last post by:
Hi Does anyone know how to edit a databound field timespan field within the xtratreelist? I tried to do this using the scheduler durationedit as repository control, but when i select a value...
0
by: morathm | last post by:
I have a windows client database management application written in C# that connects to remote web services to do all the heavy work. The thin-client app uses strong typed datasets, all maintained at...
1
by: miferdin | last post by:
Hi friends, 1. I have a datagrid with 5 columns, in this when i click edit in a row, all the columns changes into textbox but what i need is to make only a single column into a text...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.