|
-
Aug 5th, 1999, 08:04 PM
#1
Thread Starter
Lively Member
Hi all,
I have combo boxes which are populated with dynamic sql from sql 7.0. I want to have the combo box style as read only so that the user cant write in a value that is not present. The problem is that I have a grid, when the user click the grid it will populate the text part of the combo box with the users choice then go out to sql and retrieve the values for the combo box. I am unable to populate the text portion because it is read only. I guess after all this typing is how can i make the combo box read the grid but be locked if anything is typed inside of it.
thanks
Scott
-
Aug 5th, 1999, 09:13 PM
#2
Lively Member
Hi,
Try unlocking it before you write from the grid, then relock right after.
combobox.locked=false
combobox.text=gridvalue
combobox.locked=true
Hope this helps,
Preeti
-
Aug 5th, 1999, 10:41 PM
#3
Thread Starter
Lively Member
If you lock it then the combo is locked-it cant be changed at all, the dropdown wont work.
-
Aug 6th, 1999, 12:06 AM
#4
Lively Member
Hi,
Okay, now I see what you are trying to do.
Why don't you add the item to your combobox, then select that item through code:
Combobox.AddItem gridvalue
Combobox.ListIndex = Combobox.ListCount - 1
the second line will place in the text part of the combobox the last item that was entered into the combobox.
Hope this helps,
Preeti
-
Aug 6th, 1999, 01:00 AM
#5
Thread Starter
Lively Member
That works the only problem is that when i populate the combobox from the server and get items
1
2
3
if i add the item lets say 1
then my combobox looks like this
1
2
3
1
if i try to delete it afterwords then the textbox portion becomes blank.
-
Aug 6th, 1999, 11:11 AM
#6
Lively Member
How are you making the combo boxes read only now?
Whatever property you are setting, at
run-time, reset the property to read and write, then write in the value from the grid, then reset your combo box back to read-only.
Or is your question how to make a combo box read only?
Preeti
-
Aug 6th, 1999, 11:42 AM
#7
Thread Starter
Lively Member
at first i set the property in the settings, but then i wanted to do in code.
u can choose dropdown combo
simple combo or dropdown list
but i decided to try the code
combobox.style=2
only problem if i try to change it from read to write, i get warning messages.
basically i just want the user to only be able to choose values from the combo box, not write their own in.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|