Hello,
I have a lookup field in a grid.I want to disable the field such that user cannot manually enter anything.all the values can be selected only thorough the lookup.
How can i achieve this?
Thanks
Hello,
I have a lookup field in a grid.I want to disable the field such that user cannot manually enter anything.all the values can be selected only thorough the lookup.
How can i achieve this?
Thanks
As normal you cant edit lookup field…only selection will be allowed…
otherwise expand your question…
i Have a grid in a form.which has several fields(String edit) there are lookups on these fields as well.
the string edit field save the anyvalue (typed in by use or values from lookup)…i dont want this to happen the string edit should take values only from the lookup field.
is there any property that i need to change for this?
Hai Prashob,
Check the EDT of the field…if its rite then it wont happen.
If you disable the field - even the field lookup will get disabled.
If you are using an EDT for that field - put a relation in that. which wont allow other than the values available in the lookup.
Or override the validate method of the field in the form data source. Throw some error if the entered values are not what you are expecting…
a bit more explanation
col 1 col2 col3
tablefield tablefield lookup field
the lookup field is generated based on the values in col1 and col2.Like you said it is by default non editable is not trur when you have a custom lookup code.
manual entry is permitted when there is code involved…
please advice
The best option is to Override the Validate method of the lookup field.
The EDT would keep changing here.so cannot mention a fixed EDT.so the EDT method also fails.is there something i can do in code to not allow manual entry?
Hi
Bit late on this one, but try overriding the textChange() method on the relevant stringEdit control and setting its value back to a saved value (probably done in the modified() method of the same control
textChange() gets called only if the user is manually typing into the field . .