ASP.net 3.5 Lookup field strategy

Our strategy for lookup fields is to use a short code for the value of a lookup field (max 4 chars) and use a 50 varchar value to display in a drop down field.  To do this we create a lookup table with the value and display fields.  This has worked well in other development environments but not in ASP.net so far.  

Using a form view in the Item Template.  The system wants to display the value (short value) in a label, but we would like to display the long value in the field.  So I have added drop down lists for these fields by editing the field templates.  All is well except it allows the user to modify the value, although the new value is not posted.  This will confuse the users.  So I tried enable="false."  this works but the field is grayed out.  Looks wierd.  

Is there any way around this using the drop down list.  In Access for example there is an enabled property and locked property.  Lock does not gray out field.   Can't find a lock or anything that should do what I need.  Am I missing something?

Is it best just to save the long value in the underlying table and forget about short values?

Any other strategies?

Thanks for your help
deepPowdahAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alfred A.Commented:
Hi,

Why don't you change the BackColor of the Control to let say White?
0
deepPowdahAuthor Commented:
it isn't the back color is the container for the drop list.
0
Alfred A.Commented:
Can you please clarify?  You have a label and a dropdownlist, right?  Or, do you have a panel as a container with label and dropdownlist in there? So, which control/container is being grayed out when Enabled="false"?
0
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

deepPowdahAuthor Commented:
The border of the dropdown list is being grayed out.  It think it looks strange.  On the Item Template all text box fields appear as lablels and have no borders and the text is normal,black.  I would like the text to appear as in other fields black, and no dropdown list control displayed.
0
Alfred A.Commented:
Hi,

Is it possible if you could visualised it in an image and post it?

This might be "by design" especially with the dropdownlist.  If you set enabled="false" for the dropdownlist, it is grayed out (border plus text) and you cannot set the color if this is the case.

If you are using a TextBox, you can use ReadOnly="true" rather than Enabled="false" and by ReadOnly="true", you can still the color.



0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
deepPowdahAuthor Commented:
THanks for your help.  after spending the weekend on this matter, it is clear that the dropdown list does not have the attributes needed to accomplish this.  I guess I will just have to use it and insert a javascipt function to prevent changing the value.

After all the hype about .Net 3.5 I'm disappointed.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.